From 7b335661d794400078e17c589fe6ba76b483a4fd Mon Sep 17 00:00:00 2001 From: reddn Date: Wed, 1 Jun 2022 03:58:30 -0400 Subject: [PATCH 1/2] add more detail on no language set for translation also made default langauge 'en_us' instead of 'en' --- agents/meshinstall-linux.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/agents/meshinstall-linux.js b/agents/meshinstall-linux.js index 723fb6fd..1e61c04f 100644 --- a/agents/meshinstall-linux.js +++ b/agents/meshinstall-linux.js @@ -45,7 +45,7 @@ var msh = {}; var translation = JSON.parse(msh.translation); var lang = require('util-language').current; -if (lang == null) { lang = 'en'; } +if (lang == null) { lang = 'en_us'; } if (process.argv.getParameter('lang', lang) == null) { console.log('\nCurrent Language: ' + lang + '\n'); @@ -60,6 +60,7 @@ else if (translation[lang.split('-')[0]] == null) { console.log('Language: ' + lang + ' is not translated.'); + console.log("try: './meshcentral -lang=en_us'" process.exit(); } else @@ -352,4 +353,4 @@ if (!skip) console.log(e); process.exit(); }); -} \ No newline at end of file +} From f8cb33d5bfb1bd80368aab10ff6eb4aa387daf8e Mon Sep 17 00:00:00 2001 From: reddn Date: Fri, 3 Jun 2022 17:13:42 -0400 Subject: [PATCH 2/2] added fix to process.env.LANG = "C" --- agents/meshinstall-linux.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/agents/meshinstall-linux.js b/agents/meshinstall-linux.js index 1e61c04f..1ea54368 100644 --- a/agents/meshinstall-linux.js +++ b/agents/meshinstall-linux.js @@ -45,7 +45,11 @@ var msh = {}; var translation = JSON.parse(msh.translation); var lang = require('util-language').current; -if (lang == null) { lang = 'en_us'; } +if (lang == null) { lang = 'en'; } +if (lang == "C"){ + lang = 'en'; + console.log("Langauge envronment variable was not set (process.env.LANG). Defaulting to English ('en').\nSee the agent-translations.json file for a list of current languages that are implemented\nUsage: meshcentral -lang=en\n"); +} if (process.argv.getParameter('lang', lang) == null) { console.log('\nCurrent Language: ' + lang + '\n'); @@ -60,7 +64,8 @@ else if (translation[lang.split('-')[0]] == null) { console.log('Language: ' + lang + ' is not translated.'); - console.log("try: './meshcentral -lang=en_us'" + console.log("try: './meshcentral -lang=en' for English"); + console.log("See the agent-translations.json file for a list of current languages that are implemented.") process.exit(); } else