load remote translations
This commit is contained in:
25
js/index.js
25
js/index.js
@@ -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
|
||||
|
Reference in New Issue
Block a user