Sfoglia il codice sorgente

Tts add voice choose (#2452)

Co-authored-by: luowei <glpat-EjySCyNjWiLqAED-YmwM>
Co-authored-by: crazywoola <427733928@qq.com>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
Charlie.Wei 1 anno fa
parent
commit
5d8fa2c7af

+ 5 - 2
web/app/components/app/configuration/config-voice/param-config-content.tsx

@@ -69,7 +69,9 @@ const VoiceParamConfig: FC = () => {
             >
             >
               <div className={'relative h-9'}>
               <div className={'relative h-9'}>
                 <Listbox.Button className={'w-full h-full rounded-lg border-0 bg-gray-100 py-1.5 pl-3 pr-10 sm:text-sm sm:leading-6 focus-visible:outline-none focus-visible:bg-gray-200 group-hover:bg-gray-200 cursor-pointer'}>
                 <Listbox.Button className={'w-full h-full rounded-lg border-0 bg-gray-100 py-1.5 pl-3 pr-10 sm:text-sm sm:leading-6 focus-visible:outline-none focus-visible:bg-gray-200 group-hover:bg-gray-200 cursor-pointer'}>
-                  <span className={classNames('block truncate text-left', !languageItem?.name && 'text-gray-400')}>{languageItem?.name ?? localLanguagePlaceholder}</span>
+                  <span className={classNames('block truncate text-left', !languageItem?.name && 'text-gray-400')}>
+                    {t(`common.voice.language.${languageItem?.value.replace('-', '')}`) ?? localLanguagePlaceholder}
+                  </span>
                   <span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
                   <span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
                     <ChevronDownIcon
                     <ChevronDownIcon
                       className="h-5 w-5 text-gray-400"
                       className="h-5 w-5 text-gray-400"
@@ -97,7 +99,8 @@ const VoiceParamConfig: FC = () => {
                       >
                       >
                         {({ /* active, */ selected }) => (
                         {({ /* active, */ selected }) => (
                           <>
                           <>
-                            <span className={classNames('block', selected && 'font-normal')}>{item.name}</span>
+                            <span
+                              className={classNames('block', selected && 'font-normal')}>{t(`common.voice.language.${(item.value).toString().replace('-', '')}`)}</span>
                             {(selected || item.value === textToSpeechConfig.language) && (
                             {(selected || item.value === textToSpeechConfig.language) && (
                               <span
                               <span
                                 className={classNames(
                                 className={classNames(

+ 12 - 0
web/i18n/lang/common.en.ts

@@ -39,6 +39,18 @@ const translation = {
     input: 'Please enter',
     input: 'Please enter',
     select: 'Please select',
     select: 'Please select',
   },
   },
+  voice: {
+    language: {
+      zhHans: 'Chinese',
+      enUS: 'English',
+      deDE: 'German',
+      frFR: 'French',
+      esES: 'Spanish',
+      itIT: 'Italian',
+      thTH: 'Thai.',
+      idID: 'Indonesian',
+    },
+  },
   unit: {
   unit: {
     char: 'chars',
     char: 'chars',
   },
   },

+ 12 - 0
web/i18n/lang/common.pt.ts

@@ -41,6 +41,18 @@ const translation = {
       useYourModel: 'Atualmente usando seu próprio provedor de modelo.',
       useYourModel: 'Atualmente usando seu próprio provedor de modelo.',
       close: 'Fechar',
       close: 'Fechar',
     },
     },
+    voice: {
+      language: {
+        zhHans: 'chinês',
+        enUS: 'inglês',
+        deDE: 'alemão',
+        frFR: 'francês',
+        esES: 'espanhol',
+        itIT: 'italiano',
+        thTH: 'tailandês',
+        idID: 'indonésio',
+      },
+    },
     anthropicHosted: {
     anthropicHosted: {
       anthropicHosted: 'Anthropic Claude',
       anthropicHosted: 'Anthropic Claude',
       onTrial: 'EM TESTE',
       onTrial: 'EM TESTE',

+ 12 - 0
web/i18n/lang/common.zh.ts

@@ -39,6 +39,18 @@ const translation = {
     input: '请输入',
     input: '请输入',
     select: '请选择',
     select: '请选择',
   },
   },
+  voice: {
+    language: {
+      zhHans: '中文',
+      enUS: '英语',
+      deDE: '德语',
+      frFR: '法语',
+      esES: '西班牙语',
+      itIT: '意大利语',
+      thTH: '泰语',
+      idID: '印尼语',
+    },
+  },
   unit: {
   unit: {
     char: '个字符',
     char: '个字符',
   },
   },