Add JS tests. Cleanup code and add github workflow to test.

This commit is contained in:
Sudhanshu Gautam 2021-01-12 23:40:38 +05:30
parent f3133a38a0
commit 3f8de60160
20 changed files with 533 additions and 264 deletions

48
src/locales/i18n.ts Normal file
View 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;