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

@@ -1,6 +0,0 @@
{
"welcome": {
"title": "Welcome to {{framework}}",
"intro": "To get started, edit <1><0></0></1> and save to reload."
}
}

View File

@@ -0,0 +1,22 @@
{
"translation": {
"general": {
"languages": {
"english": "English",
"french": "French",
"spanish": "Spanish"
},
"title": "Welcome to {{framework}}",
"greetings": "Hello2!",
"intro": "To get started, edit <1><0></0></1> and save to reload."
},
"whiteboard": {
"viewJobImages": "View Job Images",
"printCenter": "Print Center",
"postInvoices": "Post Invoices",
"notes": "Job Notes",
"partStatus": "Part Status",
"receiveParts": "Receive Parts"
}
}
}

View File

@@ -1,6 +1,9 @@
{
"welcome": {
"title": "Welcome to {{framework}}",
"intro": "To get started, edit <1><0></0></1> and save to reload."
"translation": {
"general": {
"title": "Hola a {{framework}}",
"greetings": "Hola!",
"intro": "To get started, edit <1><0></0></1> and save to reload."
}
}
}
}

View File

@@ -1,6 +1,22 @@
{
"welcome": {
"translation": {
"general": {
"languages": {
"english": "Anglais",
"french": "Francais",
"spanish": "Espanol"
},
"title": "Welcome to {{framework}}",
"greetings": "Hello2!",
"intro": "To get started, edit <1><0></0></1> and save to reload."
},
"whiteboard": {
"viewJobImages": "Viewez le Job Images",
"printCenter": "Printez Centre",
"postInvoices": "Postez le Invoices",
"notes": "Le Job Notes",
"partStatus": "Status de Parts",
"receiveParts": "Receive Parts"
}
}
}
}

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;