mirror of
https://git.netzspielplatz.de/docker-multiarch/openwrt-firmware-selector.git
synced 2025-11-09 03:19:35 +00:00
Add JS tests. Cleanup code and add github workflow to test.
This commit is contained in:
parent
f3133a38a0
commit
3f8de60160
20 changed files with 533 additions and 264 deletions
48
src/locales/i18n.ts
Normal file
48
src/locales/i18n.ts
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
import i18n from 'i18next';
|
||||
import { initReactI18next } from 'react-i18next';
|
||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||
import translations from './translations';
|
||||
|
||||
const resources = {
|
||||
ca: {
|
||||
translation: translations.ca,
|
||||
},
|
||||
en: {
|
||||
translation: translations.en,
|
||||
},
|
||||
es: {
|
||||
translation: translations.es,
|
||||
},
|
||||
de: {
|
||||
translation: translations.de,
|
||||
},
|
||||
fr: {
|
||||
translation: translations.fr,
|
||||
},
|
||||
it: {
|
||||
translation: translations.it,
|
||||
},
|
||||
no: {
|
||||
translation: translations.no,
|
||||
},
|
||||
pl: {
|
||||
translation: translations.pl,
|
||||
},
|
||||
tr: {
|
||||
translation: translations.tr,
|
||||
},
|
||||
};
|
||||
|
||||
i18n
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
resources,
|
||||
fallbackLng: 'en',
|
||||
debug: !!process.env.REACT_APP_I18N_DEBUG,
|
||||
interpolation: {
|
||||
escapeValue: false, // not needed for react as it escapes by default
|
||||
},
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
Loading…
Add table
Add a link
Reference in a new issue