feat: support germen (#10879)

* feat: support germen

* format code

* translate

* update trans

* format

* add de

---------

Co-authored-by: Payne Fu <payne@Paynes-MBP.rcoffice.ringcentral.com>
This commit is contained in:
beyondkmp 2025-10-22 15:38:17 +08:00 committed by GitHub
parent 50798280db
commit 4063c20505
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 4712 additions and 2 deletions

View File

@ -9,6 +9,7 @@ electronLanguages:
- zh_CN # for macOS
- zh_TW # for macOS
- en # for macOS
- de
directories:
buildResources: build

View File

@ -2,6 +2,7 @@ import EnUs from '../../renderer/src/i18n/locales/en-us.json'
import ZhCn from '../../renderer/src/i18n/locales/zh-cn.json'
import ZhTw from '../../renderer/src/i18n/locales/zh-tw.json'
// Machine translation
import deDE from '../../renderer/src/i18n/translate/de-de.json'
import elGR from '../../renderer/src/i18n/translate/el-gr.json'
import esES from '../../renderer/src/i18n/translate/es-es.json'
import frFR from '../../renderer/src/i18n/translate/fr-fr.json'
@ -16,6 +17,7 @@ const locales = Object.fromEntries(
['zh-TW', ZhTw],
['ja-JP', JaJP],
['ru-RU', RuRu],
['de-DE', deDE],
['el-GR', elGR],
['es-ES', esES],
['fr-FR', frFR],

View File

@ -1,6 +1,7 @@
import { useSettings } from '@renderer/hooks/useSettings'
import { LanguageVarious } from '@renderer/types'
import { ConfigProvider, theme } from 'antd'
import deDE from 'antd/locale/de_DE'
import elGR from 'antd/locale/el_GR'
import enUS from 'antd/locale/en_US'
import esES from 'antd/locale/es_ES'
@ -126,6 +127,8 @@ function getAntdLocale(language: LanguageVarious) {
return zhTW
case 'en-US':
return enUS
case 'de-DE':
return deDE
case 'ru-RU':
return ruRU
case 'ja-JP':

View File

@ -7,7 +7,7 @@ interface UseSmoothStreamOptions {
initialText?: string
}
const languages = ['en-US', 'es-ES', 'zh-CN', 'zh-TW', 'ja-JP', 'ru-RU', 'el-GR', 'fr-FR', 'pt-PT']
const languages = ['en-US', 'de-DE', 'es-ES', 'zh-CN', 'zh-TW', 'ja-JP', 'ru-RU', 'el-GR', 'fr-FR', 'pt-PT']
const segmenter = new Intl.Segmenter(languages)
export const useSmoothStream = ({ onUpdate, streamDone, minDelay = 10, initialText = '' }: UseSmoothStreamOptions) => {

View File

@ -8,6 +8,7 @@ import enUS from './locales/en-us.json'
import zhCN from './locales/zh-cn.json'
import zhTW from './locales/zh-tw.json'
// Machine translation
import deDE from './translate/de-de.json'
import elGR from './translate/el-gr.json'
import esES from './translate/es-es.json'
import frFR from './translate/fr-fr.json'
@ -24,6 +25,7 @@ const resources = Object.fromEntries(
['ru-RU', ruRU],
['zh-CN', zhCN],
['zh-TW', zhTW],
['de-DE', deDE],
['el-GR', elGR],
['es-ES', esES],
['fr-FR', frFR],

File diff suppressed because it is too large Load Diff

View File

@ -122,6 +122,7 @@ const GeneralSettings: FC = () => {
{ value: 'zh-CN', label: '中文', flag: '🇨🇳' },
{ value: 'zh-TW', label: '中文(繁体)', flag: '🇭🇰' },
{ value: 'en-US', label: 'English', flag: '🇺🇸' },
{ value: 'de-DE', label: 'Deutsch', flag: '🇩🇪' },
{ value: 'ja-JP', label: '日本語', flag: '🇯🇵' },
{ value: 'ru-RU', label: 'Русский', flag: '🇷🇺' },
{ value: 'el-GR', label: 'Ελληνικά', flag: '🇬🇷' },

View File

@ -2,6 +2,7 @@
export type GroupTranslations = {
[key: string]: {
'el-GR': string
'de-DE': string
'en-US': string
'es-ES': string
'fr-FR': string
@ -16,6 +17,7 @@ export type GroupTranslations = {
export const groupTranslations: GroupTranslations = {
: {
'el-GR': 'Τα δικά μου',
'de-DE': 'Meine Agenten',
'en-US': 'My Agents',
'es-ES': 'Mis agentes',
'fr-FR': 'Mes agents',
@ -27,6 +29,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Επαγγελμα',
'de-DE': 'Karriere',
'en-US': 'Career',
'es-ES': 'Profesional',
'fr-FR': 'Professionnel',
@ -38,6 +41,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Εμπορικός',
'de-DE': 'Geschäft',
'en-US': 'Business',
'es-ES': 'Negocio',
'fr-FR': 'Commercial',
@ -49,6 +53,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Εργαλεία',
'de-DE': 'Werkzeuge',
'en-US': 'Tools',
'es-ES': 'Herramientas',
'fr-FR': 'Outils',
@ -60,6 +65,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Γλώσσα',
'de-DE': 'Sprache',
'en-US': 'Language',
'es-ES': 'Idioma',
'fr-FR': 'Langue',
@ -71,6 +77,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Γραφείο',
'de-DE': 'Büro',
'en-US': 'Office',
'es-ES': 'Oficina',
'fr-FR': 'Bureau',
@ -82,6 +89,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Γενικά',
'de-DE': 'Allgemein',
'en-US': 'General',
'es-ES': 'General',
'fr-FR': 'Général',
@ -93,6 +101,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Γράφημα',
'de-DE': 'Schreiben',
'en-US': 'Writing',
'es-ES': 'Escritura',
'fr-FR': 'Écriture',
@ -104,6 +113,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Επιλεγμένο',
'de-DE': 'Empfohlen',
'en-US': 'Featured',
'es-ES': 'Destacado',
'fr-FR': 'Sélection',
@ -115,6 +125,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Προγραμματισμός',
'de-DE': 'Programmierung',
'en-US': 'Programming',
'es-ES': 'Programación',
'fr-FR': 'Programmation',
@ -126,6 +137,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Αίσθημα',
'de-DE': 'Emotion',
'en-US': 'Emotion',
'es-ES': 'Emoción',
'fr-FR': 'Émotion',
@ -137,6 +149,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Εκπαίδευση',
'de-DE': 'Bildung',
'en-US': 'Education',
'es-ES': 'Educación',
'fr-FR': 'Éducation',
@ -148,6 +161,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Κreativiteit',
'de-DE': 'Kreativ',
'en-US': 'Creative',
'es-ES': 'Creativo',
'fr-FR': 'Créatif',
@ -159,6 +173,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Ακαδημικός',
'de-DE': 'Akademisch',
'en-US': 'Academic',
'es-ES': 'Académico',
'fr-FR': 'Académique',
@ -170,6 +185,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Δημιουργικό',
'de-DE': 'Design',
'en-US': 'Design',
'es-ES': 'Diseño',
'fr-FR': 'Design',
@ -181,6 +197,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Τέχνη',
'de-DE': 'Kunst',
'en-US': 'Art',
'es-ES': 'Arte',
'fr-FR': 'Art',
@ -192,6 +209,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Αναψυχή',
'de-DE': 'Unterhaltung',
'en-US': 'Entertainment',
'es-ES': 'Entretenimiento',
'fr-FR': 'Divertissement',
@ -203,6 +221,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Ζωή',
'de-DE': 'Leben',
'en-US': 'Life',
'es-ES': 'Vida',
'fr-FR': 'Vie',
@ -214,6 +233,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Υγεία',
'de-DE': 'Medizin',
'en-US': 'Medical',
'es-ES': 'Médico',
'fr-FR': 'Médical',
@ -225,6 +245,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Παιχνίδια',
'de-DE': 'Spiele',
'en-US': 'Games',
'es-ES': 'Juegos',
'fr-FR': 'Jeux',
@ -236,6 +257,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Γραφήματα',
'de-DE': 'Übersetzung',
'en-US': 'Translation',
'es-ES': 'Traducción',
'fr-FR': 'Traduction',
@ -247,6 +269,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Μουσική',
'de-DE': 'Musik',
'en-US': 'Music',
'es-ES': 'Música',
'fr-FR': 'Musique',
@ -258,6 +281,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Αξιολόγηση',
'de-DE': 'Bewertung',
'en-US': 'Review',
'es-ES': 'Revisión',
'fr-FR': 'Avis',
@ -269,6 +293,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Γραφήματα',
'de-DE': 'Texterstellung',
'en-US': 'Copywriting',
'es-ES': 'Redacción',
'fr-FR': 'Rédaction',
@ -280,6 +305,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Εγκυκλοπαίδεια',
'de-DE': 'Enzyklopädie',
'en-US': 'Encyclopedia',
'es-ES': 'Enciclopedia',
'fr-FR': 'Encyclopédie',
@ -291,6 +317,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Υγεία',
'de-DE': 'Gesundheit',
'en-US': 'Health',
'es-ES': 'Salud',
'fr-FR': 'Santé',
@ -302,6 +329,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Μάρκετινγκ',
'de-DE': 'Marketing',
'en-US': 'Marketing',
'es-ES': 'Marketing',
'fr-FR': 'Marketing',
@ -313,6 +341,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Επιστήμη',
'de-DE': 'Wissenschaft',
'en-US': 'Science',
'es-ES': 'Ciencia',
'fr-FR': 'Science',
@ -324,6 +353,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Ανάλυση',
'de-DE': 'Analyse',
'en-US': 'Analysis',
'es-ES': 'Análisis',
'fr-FR': 'Analyse',
@ -335,6 +365,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Νόμος',
'de-DE': 'Recht',
'en-US': 'Legal',
'es-ES': 'Legal',
'fr-FR': 'Légal',
@ -346,6 +377,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Συμβουλή',
'de-DE': 'Beratung',
'en-US': 'Consulting',
'es-ES': 'Consultoría',
'fr-FR': 'Consultation',
@ -357,6 +389,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Φορολογία',
'de-DE': 'Finanzen',
'en-US': 'Finance',
'es-ES': 'Finanzas',
'fr-FR': 'Finance',
@ -368,6 +401,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Τουρισμός',
'de-DE': 'Reisen',
'en-US': 'Travel',
'es-ES': 'Viajes',
'fr-FR': 'Voyages',
@ -379,6 +413,7 @@ export const groupTranslations: GroupTranslations = {
},
: {
'el-GR': 'Διοίκηση',
'de-DE': 'Management',
'en-US': 'Management',
'es-ES': 'Gestión',
'fr-FR': 'Gestion',

View File

@ -433,7 +433,17 @@ export enum ThemeMode {
}
/** 有限的UI语言 */
export type LanguageVarious = 'zh-CN' | 'zh-TW' | 'el-GR' | 'en-US' | 'es-ES' | 'fr-FR' | 'ja-JP' | 'pt-PT' | 'ru-RU'
export type LanguageVarious =
| 'zh-CN'
| 'zh-TW'
| 'de-DE'
| 'el-GR'
| 'en-US'
| 'es-ES'
| 'fr-FR'
| 'ja-JP'
| 'pt-PT'
| 'ru-RU'
export type CodeStyleVarious = 'auto' | string