mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Update i18next in runtime
This commit is contained in:
@@ -33,16 +33,16 @@ describe("api/editor/locales", function() {
|
||||
locales.init({
|
||||
i18n: {
|
||||
i: {
|
||||
lng: function() { return 'en-US'},
|
||||
setLng: function(lang,callback) {
|
||||
language: function() { return 'en-US'},
|
||||
changeLanguage: function(lang,callback) {
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
getResourceBundle: function(lang, namespace) {
|
||||
return {namespace:namespace, lang:lang};
|
||||
}
|
||||
},
|
||||
catalog: function(namespace, lang) {
|
||||
return {namespace:namespace, lang:lang};
|
||||
}
|
||||
}
|
||||
});
|
||||
app = express();
|
||||
@@ -81,13 +81,15 @@ describe("api/editor/locales", function() {
|
||||
// bit of a mess of internal workings
|
||||
locales.init({
|
||||
i18n: {
|
||||
catalog: function(namespace, lang) {
|
||||
return {
|
||||
"node-red": "should not return",
|
||||
"test-module-a-id": "test-module-a-catalog",
|
||||
"test-module-b-id": "test-module-b-catalog",
|
||||
"test-module-c-id": "test-module-c-catalog"
|
||||
}[namespace]
|
||||
i:{
|
||||
getResourceBundle: function(lang, namespace) {
|
||||
return {
|
||||
"node-red": "should not return",
|
||||
"test-module-a-id": "test-module-a-catalog",
|
||||
"test-module-b-id": "test-module-b-catalog",
|
||||
"test-module-c-id": "test-module-c-catalog"
|
||||
}[namespace]
|
||||
}
|
||||
}
|
||||
},
|
||||
nodes: {
|
||||
|
Reference in New Issue
Block a user