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

Merge pull request #2796 from fellinga/feature/lang-select

add optional lang select
This commit is contained in:
Nick O'Leary 2021-01-07 17:15:36 +00:00 committed by GitHub
commit 09b37cf538
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -33,7 +33,7 @@ module.exports = {
*/ */
init: function(settings) { init: function(settings) {
log.init(settings); log.init(settings);
i18n.init(); i18n.init(settings);
}, },
/** /**

View File

@ -142,7 +142,7 @@ function getCurrentLocale() {
return undefined; return undefined;
} }
function init() { function init(settings) {
if (!initPromise) { if (!initPromise) {
// Keep this as a 'when' promise as top-level red.js uses 'otherwise' // Keep this as a 'when' promise as top-level red.js uses 'otherwise'
// and embedded users of NR may have copied that. // and embedded users of NR may have copied that.
@ -160,7 +160,7 @@ function init() {
suffix: '__' suffix: '__'
} }
}; };
var lang = getCurrentLocale(); var lang = settings.lang || getCurrentLocale();
if (lang) { if (lang) {
opt.lng = lang; opt.lng = lang;
} }

View File

@ -248,6 +248,8 @@ module.exports = {
// their values. Setting this to true will cause the keys to be listed. // their values. Setting this to true will cause the keys to be listed.
exportGlobalContextKeys: false, exportGlobalContextKeys: false,
// Uncomment the following to run node-red in your preferred language:
// lang: "de",
// Context Storage // Context Storage
// The following property can be used to enable context storage. The configuration // The following property can be used to enable context storage. The configuration