Added langauge localization files to use masterdata and futureproof translations.
This commit is contained in:
29
client/src/translations/i18n.js
Normal file
29
client/src/translations/i18n.js
Normal 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;
|
||||
Reference in New Issue
Block a user