mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-21 22:15:40 +00:00
8f18f73b33
Adds complete Spanish locale with 964 translated strings. Registered in i18n.ts, added to language dropdown in Settings. 8 languages total.
39 lines
1.1 KiB
TypeScript
39 lines
1.1 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';
|
|
|
|
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 },
|
|
},
|
|
lng: savedLanguage,
|
|
fallbackLng: 'en',
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
});
|
|
|
|
i18n.on('languageChanged', lng => {
|
|
localStorage.setItem('psysonic_language', lng);
|
|
});
|
|
|
|
export default i18n;
|