mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-21 23:05:46 +00:00
7a4bdbc88e
* feat(i18n): Add Romanian translation * feat(i18n): Update Romanian translation to lang file changes * feat(i18n): Add new Romanian translation entries * fix(i18n): add settings.languageRo to remaining locale bundles Romanian was missing from the language picker labels when UI was not en/ro; add endonym-style names per locale (de/fr/nl/nb/ru/es/zh) for consistency. * fix(i18n): use Romanian autonym for settings.languageRo everywhere Match existing language picker convention (e.g. languageDe is Deutsch in every locale bundle). Replaces UI-language translations of Romanian.
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
import { deTranslation } from './locales/de';
|
|
import { enTranslation } from './locales/en';
|
|
import { frTranslation } from './locales/fr';
|
|
import { zhTranslation } from './locales/zh';
|
|
import { nbTranslation } from './locales/nb';
|
|
import { ruTranslation } from './locales/ru';
|
|
import { nlTranslation } from './locales/nl';
|
|
import { esTranslation } from './locales/es';
|
|
import { roTranslation } from './locales/ro';
|
|
|
|
const savedLanguage = localStorage.getItem('psysonic_language') || 'en';
|
|
|
|
i18n
|
|
.use(initReactI18next)
|
|
.init({
|
|
resources: {
|
|
en: { translation: enTranslation },
|
|
de: { translation: deTranslation },
|
|
es: { translation: esTranslation },
|
|
fr: { translation: frTranslation },
|
|
nl: { translation: nlTranslation },
|
|
zh: { translation: zhTranslation },
|
|
nb: { translation: nbTranslation },
|
|
ru: { translation: ruTranslation },
|
|
ro: { translation: roTranslation },
|
|
},
|
|
lng: savedLanguage,
|
|
fallbackLng: 'en',
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
});
|
|
|
|
i18n.on('languageChanged', lng => {
|
|
localStorage.setItem('psysonic_language', lng);
|
|
});
|
|
|
|
export default i18n;
|