i18n: add French, Russian, Chinese Simplified, and Dutch translations

This commit is contained in:
Maurice
2026-03-29 01:02:41 +01:00
parent 433d780f74
commit ecf7433980
6 changed files with 4339 additions and 3 deletions
+7 -3
View File
@@ -3,18 +3,22 @@ import { useSettingsStore } from '../store/settingsStore'
import de from './translations/de' import de from './translations/de'
import en from './translations/en' import en from './translations/en'
import es from './translations/es' import es from './translations/es'
import fr from './translations/fr'
import ru from './translations/ru'
import zh from './translations/zh'
import nl from './translations/nl'
type TranslationStrings = Record<string, string> type TranslationStrings = Record<string, string>
const translations: Record<string, TranslationStrings> = { de, en, es } const translations: Record<string, TranslationStrings> = { de, en, es, fr, ru, zh, nl }
const LOCALES: Record<string, string> = { de: 'de-DE', en: 'en-US', es: 'es-ES' } const LOCALES: Record<string, string> = { de: 'de-DE', en: 'en-US', es: 'es-ES', fr: 'fr-FR', ru: 'ru-RU', zh: 'zh-CN', nl: 'nl-NL' }
export function getLocaleForLanguage(language: string): string { export function getLocaleForLanguage(language: string): string {
return LOCALES[language] || LOCALES.en return LOCALES[language] || LOCALES.en
} }
export function getIntlLanguage(language: string): string { export function getIntlLanguage(language: string): string {
return language === 'de' || language === 'es' ? language : 'en' return ['de', 'es', 'fr', 'ru', 'zh', 'nl'].includes(language) ? language : 'en'
} }
interface TranslationContextValue { interface TranslationContextValue {
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+4
View File
@@ -270,6 +270,10 @@ export default function SettingsPage(): React.ReactElement {
{ value: 'de', label: 'Deutsch' }, { value: 'de', label: 'Deutsch' },
{ value: 'en', label: 'English' }, { value: 'en', label: 'English' },
{ value: 'es', label: 'Español' }, { value: 'es', label: 'Español' },
{ value: 'fr', label: 'Français' },
{ value: 'nl', label: 'Nederlands' },
{ value: 'ru', label: 'Русский' },
{ value: 'zh', label: '中文' },
].map(opt => ( ].map(opt => (
<button <button
key={opt.value} key={opt.value}