diff options
Diffstat (limited to 'web/Application.js')
-rw-r--r-- | web/Application.js | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/web/Application.js b/web/Application.js index 2cd8df2a0..c522d50f7 100644 --- a/web/Application.js +++ b/web/Application.js @@ -14,15 +14,35 @@ * limitations under the License. */ -Ext.application({ - name: 'Traccar', - requires: [ - 'Strings', - 'Styles', - 'Login' - ], +Ext.Loader.setConfig({ + disableCaching: false +}); + +Ext.Loader.loadScript({ + + url: function() { + var urlParams = document.URL.split("?"); + var params = Ext.urlDecode(urlParams[urlParams.length - 1]); + + if (!params.lang) { + return "Strings.js"; + } else { + return "Strings-" + params.lang + ".js"; + } + }(), + + onLoad: function() { + + Ext.application({ + name: 'Traccar', + requires: [ + 'Styles', + 'Login' + ], - launch: function() { - Ext.create('Login').show(); + launch: function() { + Ext.create('Login').show(); + } + }); } }); |