diff --git a/app/assets/js/langloader.js b/app/assets/js/langloader.js index a4bacbe1..c023aed6 100644 --- a/app/assets/js/langloader.js +++ b/app/assets/js/langloader.js @@ -1,11 +1,12 @@ const fs = require('fs-extra') const path = require('path') const toml = require('toml') +const merge = require('lodash.merge') let lang exports.loadLanguage = function(id){ - lang = toml.parse(fs.readFileSync(path.join(__dirname, '..', 'lang', `${id}.toml`))) || {} + lang = merge(lang || {}, toml.parse(fs.readFileSync(path.join(__dirname, '..', 'lang', `${id}.toml`))) || {}) } exports.query = function(id, placeHolders){ @@ -29,4 +30,12 @@ exports.queryJS = function(id, placeHolders){ exports.queryEJS = function(id, placeHolders){ return exports.query(`ejs.${id}`, placeHolders) +} + +exports.setupLanguage = function(){ + // Load Language Files + exports.loadLanguage('en_US') + + // Uncomment this when translations are ready + //exports.loadLanguage('xx_XX') } \ No newline at end of file diff --git a/app/assets/js/preloader.js b/app/assets/js/preloader.js index ae01bb83..95ead733 100644 --- a/app/assets/js/preloader.js +++ b/app/assets/js/preloader.js @@ -23,7 +23,7 @@ DistroAPI['commonDir'] = ConfigManager.getCommonDirectory() DistroAPI['instanceDir'] = ConfigManager.getInstanceDirectory() // Load Strings -LangLoader.loadLanguage('en_US') +LangLoader.setupLanguage() /** * diff --git a/app/assets/js/scripts/landing.js b/app/assets/js/scripts/landing.js index b675cea9..06d29ecb 100644 --- a/app/assets/js/scripts/landing.js +++ b/app/assets/js/scripts/landing.js @@ -738,7 +738,7 @@ let newsLoadingListener = null */ function setNewsLoading(val){ if(val){ - const nLStr = Lang.queryJS('landing.news.loading') + const nLStr = Lang.queryJS('landing.news.checking') let dotStr = '..' nELoadSpan.innerHTML = nLStr + dotStr newsLoadingListener = setInterval(() => { diff --git a/app/settings.ejs b/app/settings.ejs index 18bec3c5..fd83121f 100644 --- a/app/settings.ejs +++ b/app/settings.ejs @@ -245,7 +245,7 @@ -