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

Ensure node help is loaded in the right language

Fixes #2195
This commit is contained in:
Nick O'Leary 2019-06-06 14:16:19 +01:00
parent 6b7e623d33
commit 617628b886
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 6 additions and 3 deletions

View File

@ -51,7 +51,7 @@ RED.i18n = (function() {
}, },
loadNodeCatalog: function(namespace,done) { loadNodeCatalog: function(namespace,done) {
var languageList = i18n.functions.toLanguages(i18n.detectLanguage()); var languageList = i18n.functions.toLanguages(localStorage.getItem("editor-language")||i18n.detectLanguage());
var toLoad = languageList.length; var toLoad = languageList.length;
languageList.forEach(function(lang) { languageList.forEach(function(lang) {
$.ajax({ $.ajax({
@ -73,7 +73,7 @@ RED.i18n = (function() {
}, },
loadNodeCatalogs: function(done) { loadNodeCatalogs: function(done) {
var languageList = i18n.functions.toLanguages(i18n.detectLanguage()); var languageList = i18n.functions.toLanguages(localStorage.getItem("editor-language")||i18n.detectLanguage());
var toLoad = languageList.length; var toLoad = languageList.length;
languageList.forEach(function(lang) { languageList.forEach(function(lang) {

View File

@ -107,9 +107,12 @@ var RED = (function() {
} }
function loadNodes() { function loadNodes() {
var lang = localStorage.getItem("editor-language")||i18n.detectLanguage();
$.ajax({ $.ajax({
headers: { headers: {
"Accept":"text/html" "Accept":"text/html",
"Accept-Language": lang
}, },
cache: false, cache: false,
url: 'nodes', url: 'nodes',