load remote translations

This commit is contained in:
s2
2019-04-16 09:02:57 +02:00
parent f90d862786
commit f4fb72f363
22 changed files with 727 additions and 27 deletions

View File

@@ -84,6 +84,7 @@
// set language
i18next
.use(i18nextBrowserLanguageDetector)
.use(i18nextXHRBackend)
.init({
detection: {
order: ['querystring', 'cookie', 'navigator'],
@@ -94,26 +95,9 @@
},
whitelist: ['en', 'de', 'it'],
nonExplicitWhitelist: true,
fallbackLng: 'en',
resources: {
en: {
translation: {
'vanillaJS': 'vanillaJS seed project',
'awesome': 'This is an awesome app!'
}
},
it: {
translation: {
'vanillaJS': 'progetto di esempio vanillaJS',
'awesome': 'Questa app è fantastica!'
}
},
de: {
translation: {
'vanillaJS': 'vanillaJS Beispiel Projekt',
'awesome': 'Coole app.'
}
}
fallbackLng: 'it',
backend: {
loadPath: '/i18n/{{lng}}.json'
}
})
.then(function() {
@@ -124,6 +108,7 @@
//removeURLParameter does not return the hash. add it back if there is one.
newUrl = newUrl + window.location.hash;
window.location = newUrl;
return;
}
// render main shell