1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

move i18n info text of core nodes under nodes/core/locales directory

This commit is contained in:
Hiroyasu Nishiyama 2018-03-03 10:39:11 +09:00
parent 1e82b66bf0
commit 341ff9bf5c
35 changed files with 11 additions and 2 deletions

View File

@ -376,9 +376,18 @@ function addModule(module) {
} }
function loadNodeHelp(node,lang) { function loadNodeHelp(node,lang) {
var dir = path.dirname(node.template);
var base = path.basename(node.template); var base = path.basename(node.template);
var localePath = path.join(dir,"locales",lang,base); var localePath = undefined;
if (node.module === 'node-red') {
var cat_dir = path.dirname(node.template);
var cat = path.basename(cat_dir);
var dir = path.dirname(cat_dir);
localePath = path.join(dir, "locales", lang, cat, base)
}
else {
var dir = path.dirname(node.template);
localePath = path.join(dir,"locales",lang,base);
}
try { try {
// TODO: make this async // TODO: make this async
var content = fs.readFileSync(localePath, "utf8") var content = fs.readFileSync(localePath, "utf8")