aboutsummaryrefslogtreecommitdiff
path: root/web/Application.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-04-25 16:51:54 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-04-25 16:51:54 +1200
commit67dc1c43932bffaf9df2c9ec201cff879d0226d9 (patch)
tree18c96e48641c5fd681f2b1b4269f0793bd6d288e /web/Application.js
parent6a0f2db76a2a60679183b98720a0e48d76778d26 (diff)
downloadtraccar-server-67dc1c43932bffaf9df2c9ec201cff879d0226d9.tar.gz
traccar-server-67dc1c43932bffaf9df2c9ec201cff879d0226d9.tar.bz2
traccar-server-67dc1c43932bffaf9df2c9ec201cff879d0226d9.zip
Support interface localization
Diffstat (limited to 'web/Application.js')
-rw-r--r--web/Application.js38
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();
+ }
+ });
}
});