mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-05 07:34:25 +00:00
feat(transcript): add Chinese script choices
This commit is contained in:
@@ -5,6 +5,7 @@ import { NativeSelect, NativeSelectOption } from '@/ui/components/ui/native-sele
|
||||
import { ScrollArea } from '@/ui/components/ui/scroll-area'
|
||||
import type { MediaController } from '@/ui/components/viewers/types'
|
||||
import { savedTranscriptKey } from '@/ui/hooks/use-video-transcript'
|
||||
import { getChineseTranscriptLanguageName } from '@/ui/lib/transcript'
|
||||
import { cn } from '@/ui/lib/utils'
|
||||
import { m } from '@/ui/paraglide/messages.js'
|
||||
import { getLocale } from '@/ui/paraglide/runtime.js'
|
||||
@@ -69,7 +70,10 @@ export const TranscriptPanel = memo(function TranscriptPanel({
|
||||
const options = useMemo(() => {
|
||||
const names = new Intl.DisplayNames(locale, { type: 'language' })
|
||||
return languages
|
||||
.map((code) => ({ code, name: names.of(code) ?? code }))
|
||||
.map((code) => ({
|
||||
code,
|
||||
name: getChineseTranscriptLanguageName(code) ?? names.of(code) ?? code,
|
||||
}))
|
||||
.sort((a, b) => a.name.localeCompare(b.name, locale))
|
||||
}, [languages, locale])
|
||||
const [preferredLanguage, setPreferredLanguage] = useState<string>(locale)
|
||||
|
||||
Reference in New Issue
Block a user