aboutsummaryrefslogtreecommitdiff
path: root/web/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app.js')
-rw-r--r--web/app.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/web/app.js b/web/app.js
index 9599373a6..7b007a982 100644
--- a/web/app.js
+++ b/web/app.js
@@ -18,6 +18,25 @@ Ext.Loader.setConfig({
disableCaching: false
});
+{
+ var available = {
+ 'en': true,
+ 'ru': true
+ };
+
+ var language = Ext.Object.fromQueryString(window.location.search.substring(1)).locale;
+ if (language === undefined) {
+ language = window.navigator.userLanguage || window.navigator.language;
+ language = language.substr(0, 2);
+ }
+
+ if (!(language in available)) {
+ language = 'en'; // default
+ }
+
+ Ext.Loader.loadScript('/l10n/' + language + '.js');
+}
+
Ext.application({
name: 'Traccar',
extend: 'Traccar.Application'