Move app-specific location of language files

The core directory should only contain core API code that isn't
specific to an application.
This commit is contained in:
Samuel Mannehed 2016-10-28 14:30:14 +02:00
parent e3ded092e2
commit a93cda3a36
3 changed files with 10 additions and 8 deletions

View File

@ -27,9 +27,10 @@ var UI;
/* [begin skip-as-module] */
// Load supporting scripts
WebUtil.load_scripts(
{'core': [Util.Localisation.getLanguageFileLocation(), "base64.js", "websock.js", "des.js", "input/keysymdef.js",
"input/xtscancodes.js", "input/util.js", "input/devices.js",
"display.js", "inflator.js", "rfb.js", "input/keysym.js"]});
{'core': [WebUtil.getLanguageFileLocation(), "base64.js", "websock.js",
"des.js", "input/keysymdef.js", "input/xtscancodes.js",
"input/util.js", "input/devices.js", "display.js",
"inflator.js", "rfb.js", "input/keysym.js"]});
window.onscriptsload = function () { UI.load(); };
/* [end skip-as-module] */

View File

@ -371,6 +371,12 @@ WebUtil.releaseCapture = function () {
}
};
// Get language file location
WebUtil.getLanguageFileLocation = function () {
return '../app/locale/locale-'+Util.Localisation.getLanguageCode()+'.js';
};
// Dynamically load scripts without using document.write()
// Reference: http://unixpapa.com/js/dyna.html
//

View File

@ -385,11 +385,6 @@ Util.Localisation = {
'de-DE': 'de-DE'
},
// Get language file location
getLanguageFileLocation: function () {
return '../app/locale/locale-'+Util.Localisation.getLanguageCode()+'.js';
},
// Get language code from browser and verify it
getLanguageCode: function () {
var languageCode = Util.Localisation.getUserPreferredLanguage();