mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-05 15:44:28 +00:00
Add Chinese transcript script choices and language search (#562)
* feat(transcript): add Chinese script choices * feat(transcript): add a popup language search
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const transcriptLanguageCodeSchema = z.string().regex(/^[a-z]{2,3}$/)
|
||||
export const transcriptionProviderLanguageCodeSchema = z.string().regex(/^[a-z]{2,3}$/)
|
||||
export const chineseTranscriptLanguageSchema = z.enum(['zh-Hans', 'zh-Hant'])
|
||||
export const transcriptLanguageCodeSchema = transcriptionProviderLanguageCodeSchema.or(
|
||||
chineseTranscriptLanguageSchema,
|
||||
)
|
||||
|
||||
export type SavedTranscriptLanguages = { languages: string[] }
|
||||
|
||||
@@ -25,11 +29,6 @@ export const updateTranscriptSegmentRequestSchema = z.strictObject({
|
||||
text: z.string().refine((text) => !text.includes('\0')),
|
||||
})
|
||||
|
||||
export const transcriptLanguagesSchema = z.object({
|
||||
model: z.string().min(1),
|
||||
languages: z.array(z.object({ code: transcriptLanguageCodeSchema, name: z.string().min(1) })),
|
||||
})
|
||||
|
||||
interface TranscriptVideoProxy {
|
||||
key?: string
|
||||
resolution?: string
|
||||
|
||||
Reference in New Issue
Block a user