Added langauge localization files to use masterdata and futureproof translations.
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"welcome": {
|
||||
"title": "Welcome to {{framework}}",
|
||||
"intro": "To get started, edit <1><0></0></1> and save to reload."
|
||||
}
|
||||
}
|
||||
22
client/src/translations/en_us/common.json
Normal file
22
client/src/translations/en_us/common.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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