Added langauge localization files to use masterdata and futureproof translations.

This commit is contained in:
Patrick Fic
2019-12-31 12:57:17 -08:00
parent 14147ded53
commit 226933f2d7
11 changed files with 170 additions and 73 deletions

View File

@@ -0,0 +1,29 @@
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import en_Translation from "./en_us/common.json";
import fr_Translation from "./fr/common.json";
import es_Translation from "./es/common.json";
// the translations
// (tip move them in a JSON file and import them)
const resources = {
en_us: en_Translation,
fr: fr_Translation,
es: es_Translation
};
i18n
.use(initReactI18next) // passes i18n down to react-i18next
.init({
resources,
lng: "en_us",
fallbackLng: "en-us",
debug: true,
//keySeparator: false, // we do not use keys in form messages.welcome
interpolation: {
escapeValue: false // react already safes from xss
}
});
export default i18n;