mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Load base locales in editor
This commit is contained in:
@@ -86,7 +86,7 @@ function init(adminApp,storage) {
|
||||
adminApp.get("/nodes/:mod/:set",needsPermission("nodes.read"),nodes.getSet);
|
||||
adminApp.put("/nodes/:mod/:set",needsPermission("nodes.write"),nodes.putSet);
|
||||
|
||||
adminApp.get(/^\/locales\/(.+?)\/(.*)$/,needsPermission("nodes.read"),locales.get);
|
||||
adminApp.get(/^\/locales\/(.+?)\/(.*).json$/,needsPermission("nodes.read"),locales.get);
|
||||
|
||||
// Library
|
||||
library.init(adminApp);
|
||||
|
12
red/i18n.js
12
red/i18n.js
@@ -22,9 +22,13 @@ var fs = require("fs");
|
||||
var defaultLang = "en-US";
|
||||
|
||||
var resourceMap = {
|
||||
"messages": {
|
||||
"runtime": {
|
||||
basedir: path.resolve(__dirname+"/../locales"),
|
||||
file:"messages.json"
|
||||
file:"runtime.json"
|
||||
},
|
||||
"editor": {
|
||||
basedir: path.resolve(__dirname+"/../locales"),
|
||||
file: "editor.json"
|
||||
}
|
||||
}
|
||||
var resourceCache = {}
|
||||
@@ -69,8 +73,8 @@ function init() {
|
||||
i18n.backend(MessageFileLoader);
|
||||
i18n.init({
|
||||
ns: {
|
||||
namespaces: ["messages"],
|
||||
defaultNs: "messages"
|
||||
namespaces: ["runtime","editor"],
|
||||
defaultNs: "runtime"
|
||||
},
|
||||
fallbackLng: ['en-US']
|
||||
},function() {
|
||||
|
Reference in New Issue
Block a user