diff --git a/src/main/webapp/m/index.html b/src/main/webapp/m/index.html index c0c1dc6f..5fa69c14 100644 --- a/src/main/webapp/m/index.html +++ b/src/main/webapp/m/index.html @@ -14,28 +14,7 @@ - + @@ -78,7 +57,7 @@
-

{{i18n.open_desktop_version}}

+

{{i18n.open_desktop_version}}

{{i18n.logout}}

diff --git a/src/main/webapp/m/js/i18n/Messages.js b/src/main/webapp/m/js/i18n/Messages.js index 1f3e66ce..d43ef4a3 100644 --- a/src/main/webapp/m/js/i18n/Messages.js +++ b/src/main/webapp/m/js/i18n/Messages.js @@ -1,25 +1,288 @@ var i18n = { - // login screen - username: 'Username', - password: 'Password', - your_username: 'Your username', - your_password: 'Your password', - sign_in: 'Sign In', - user_name_and_password_must_not_be_empty: 'User name and password must not be empty', - user_name_or_password_is_invalid: 'User name or password is invalid', - unexpected_error: 'Unexpected error', - open_desktop_version: 'Open Desktop version', - // sidebar - devices: 'Devices', - logout: 'Logout', - // device details - select_on_map: 'Select on map', - no_data_available: 'No data available', - time: 'Time', - latitude: 'Latitude', - longitude: 'Longitude', - altitude: 'Altitude', - speed: 'Speed', - course: 'Course', - address: 'Address' + en: { + _name_: 'English', + // login screen + username: 'Username', + password: 'Password', + your_username: 'Your username', + your_password: 'Your password', + sign_in: 'Sign In', + user_name_and_password_must_not_be_empty: 'User name and password must not be empty', + user_name_or_password_is_invalid: 'User name or password is invalid', + unexpected_error: 'Unexpected error', + open_desktop_version: 'Open Desktop version', + // sidebar + devices: 'Devices', + logout: 'Logout', + // device details + select_on_map: 'Select on map', + no_data_available: 'No data available', + time: 'Time', + latitude: 'Latitude', + longitude: 'Longitude', + altitude: 'Altitude', + speed: 'Speed', + course: 'Course', + address: 'Address' + }, + de: { + _name_: 'German', + // login screen + username: 'User', + password: 'Passwort', + your_username: 'Your username', + your_password: 'Your password', + sign_in: 'Login', + user_name_and_password_must_not_be_empty: 'Username und Passwort dürfen nicht leer sein!', + user_name_or_password_is_invalid: 'Username oder Passwort ist falsch', + unexpected_error: 'Unexpected error', + open_desktop_version: 'Open Desktop version', + // sidebar + devices: 'Geräte', + logout: 'Logout', + // device details + select_on_map: 'Select on map', + no_data_available: 'No data available', + time: 'Zeit', + latitude: 'Breite', + longitude: 'Länge', + altitude: 'Höhe', + speed: 'Geschwindigkeit', + course: 'Richtung', + address: 'Adresse' + }, + es: { + _name_: 'Spanish', + // login screen + username: 'Usuario', + password: 'Contraseña', + your_username: 'Your username', + your_password: 'Your password', + sign_in: 'Entrar', + user_name_and_password_must_not_be_empty: 'Nombre de usuario y contraseña no deben de estar vacios', + user_name_or_password_is_invalid: 'Nombre de usuario o contraseña invalido', + unexpected_error: 'Unexpected error', + open_desktop_version: 'Open Desktop version', + // sidebar + devices: 'Dispositivos', + logout: 'Cerrar sesión', + // device details + select_on_map: 'Select on map', + no_data_available: 'No data available', + time: 'Hora', + latitude: 'Latitud', + longitude: 'Longitud', + altitude: 'Altura', + speed: 'Velocidad', + course: 'Curso', + address: 'Dirección' + }, + hu: { + _name_: 'Hungarian', + // login screen + username: 'Felhasználó', + password: 'Jelszó', + your_username: 'Your username', + your_password: 'Your password', + sign_in: 'Bejelentkezés', + user_name_and_password_must_not_be_empty: 'Felhasználónév és a jelszó mező nem lehet üres!', + user_name_or_password_is_invalid: 'Felhasználónév vagy a jelszó nem megfelelő!', + unexpected_error: 'Unexpected error', + open_desktop_version: 'Open Desktop version', + // sidebar + devices: 'Eszközök', + logout: 'Kijelentkezés', + // device details + select_on_map: 'Select on map', + no_data_available: 'No data available', + time: 'Idő', + latitude: 'Szélesség', + longitude: 'Hosszúság', + altitude: 'Magasság', + speed: 'Sebesség', + course: 'Irány', + address: 'Cím' + }, + it: { + _name_: 'Italian', + // login screen + username: 'Utente', + password: 'Password', + your_username: 'Your username', + your_password: 'Your password', + sign_in: 'Login', + user_name_and_password_must_not_be_empty: 'Nome Utente e Password non possono essere vuoti', + user_name_or_password_is_invalid: 'Nome Utente e Password non sono validi', + unexpected_error: 'Unexpected error', + open_desktop_version: 'Open Desktop version', + // sidebar + devices: 'Dispositivi', + logout: 'Chiudi Sessione', + // device details + select_on_map: 'Select on map', + no_data_available: 'No data available', + time: 'Ora', + latitude: 'Latitudine', + longitude: 'Longitudine', + altitude: 'Altitudine', + speed: 'Velocità', + course: 'Percorso', + address: 'Indirizzo' + }, + lt: { + _name_: 'Latvian', + // login screen + username: 'Vardas', + password: 'Slaptažodis', + your_username: 'Your username', + your_password: 'Your password', + sign_in: 'Prisijungti', + user_name_and_password_must_not_be_empty: 'Vardas ir slaptažodis negali būti tušti', + user_name_or_password_is_invalid: 'Vardas arba slaptažodis klaidingi', + unexpected_error: 'Unexpected error', + open_desktop_version: 'Open Desktop version', + // sidebar + devices: 'Įrenginiai', + logout: 'Atsijungti', + // device details + select_on_map: 'Select on map', + no_data_available: 'No data available', + time: 'Laikas', + latitude: 'Platuma', + longitude: 'Ilguma', + altitude: 'Aukštis', + speed: 'Greitis', + course: 'Kursas', + address: 'Adresas' + }, + nl: { + _name_: 'Danish', + // login screen + username: 'Gebruiker', + password: 'Wachtwoord', + your_username: 'Your username', + your_password: 'Your password', + sign_in: 'Inloggen', + user_name_and_password_must_not_be_empty: 'Gebruikersnaam en wachtwoord mogen niet leeg zijn', + user_name_or_password_is_invalid: 'Gebruikersnaam en wachtwoord zijn incorrect', + unexpected_error: 'Unexpected error', + open_desktop_version: 'Open Desktop version', + // sidebar + devices: 'Apparaten', + logout: 'Uitloggen', + // device details + select_on_map: 'Select on map', + no_data_available: 'No data available', + time: 'Tijd', + latitude: 'Breedtegraad', + longitude: 'Lengtegraad', + altitude: 'Hoogte', + speed: 'Snelheid', + course: 'Richting', + address: 'Adres' + }, + pl: { + _name_: 'Polish', + // login screen + username: 'U\u017Cytkownik', + password: 'Has\u0142o', + your_username: 'Your username', + your_password: 'Your password', + sign_in: 'Zaloguj', + user_name_and_password_must_not_be_empty: 'Nazwa u\u017Cytkownika lub has\u0142o nie mog\u0105 by\u0107 puste!', + user_name_or_password_is_invalid: 'Nazwa u\u017Cytkownika lub has\u0142o s\u0105 niepoprawne!', + unexpected_error: 'Unexpected error', + open_desktop_version: 'Open Desktop version', + // sidebar + devices: 'Urz\u0105dzenia (pojazdy)', + logout: 'Wyloguj', + // device details + select_on_map: 'Select on map', + no_data_available: 'No data available', + time: 'Czas', + latitude: 'Szeroko\u015B\u0107', + longitude: 'D\u0142ugo\u015B\u0107', + altitude: 'Wysoko\u015B\u0107', + speed: 'Pr\u0119dko\u015B\u0107', + course: 'Kierunek', + address: 'Adres' + }, + pt_PT: { + _name_: 'Portuguese', + // login screen + username: 'Utilizador', + password: 'Palavra-passe', + your_username: 'Your username', + your_password: 'Your password', + sign_in: 'Aceder', + user_name_and_password_must_not_be_empty: 'Utilizador e palavra-passe não podem ser vazios', + user_name_or_password_is_invalid: 'Utilizador ou palavra-passe inválidos', + unexpected_error: 'Unexpected error', + open_desktop_version: 'Open Desktop version', + // sidebar + devices: 'Dispositivos', + logout: 'Sair', + // device details + select_on_map: 'Select on map', + no_data_available: 'No data available', + time: 'Hora', + latitude: 'Latitude', + longitude: 'Longitude', + altitude: 'Altitude', + speed: 'Velocidade', + course: 'Rota', + address: 'Morada' + }, + ru: { + _name_: 'Russian', + // login screen + username: 'Имя пользователя', + password: 'Пароль', + your_username: 'Ваше имя пользователя', + your_password: 'Ваш пароль', + sign_in: 'Войти', + user_name_and_password_must_not_be_empty: 'Имя пользователя и пароль должны быть заполнены', + user_name_or_password_is_invalid: 'Неправильное имя пользователя или пароль', + unexpected_error: 'Неизвестная ошибка', + open_desktop_version: 'Открыть полную версию', + // sidebar + devices: 'Устройства', + logout: 'Выйти', + // device details + select_on_map: 'Выбрать на карте', + no_data_available: 'Нет данных', + time: 'Время', + latitude: 'Широта', + longitude: 'Долгота', + altitude: 'Высота', + speed: 'Скорость', + course: 'Курс', + address: 'Адрес' + }, + tl: { + _name_: 'Tagalog', + // login screen + username: 'Username', + password: 'Password', + your_username: 'Your username', + your_password: 'Your password', + sign_in: 'Sign In', + user_name_and_password_must_not_be_empty: 'User name and password must not be empty', + user_name_or_password_is_invalid: 'User name or password is invalid', + unexpected_error: 'Unexpected error', + open_desktop_version: 'Open Desktop version', + // sidebar + devices: 'Devices', + logout: 'Logout', + // device details + select_on_map: 'Select on map', + no_data_available: 'No data available', + time: 'Time', + latitude: 'Latitude', + longitude: 'Longitude', + altitude: 'Altitude', + speed: 'Speed', + course: 'Course', + address: 'Address' + } }; \ No newline at end of file diff --git a/src/main/webapp/m/js/i18n/Messages_de.js b/src/main/webapp/m/js/i18n/Messages_de.js deleted file mode 100644 index bd3f63a6..00000000 --- a/src/main/webapp/m/js/i18n/Messages_de.js +++ /dev/null @@ -1,25 +0,0 @@ -var i18n = { - // login screen - username: 'User', - password: 'Passwort', - your_username: 'Your username', - your_password: 'Your password', - sign_in: 'Login', - user_name_and_password_must_not_be_empty: 'Username und Passwort dürfen nicht leer sein!', - user_name_or_password_is_invalid: 'Username oder Passwort ist falsch', - unexpected_error: 'Unexpected error', - open_desktop_version: 'Open Desktop version', - // sidebar - devices: 'Geräte', - logout: 'Logout', - // device details - select_on_map: 'Select on map', - no_data_available: 'No data available', - time: 'Zeit', - latitude: 'Breite', - longitude: 'Länge', - altitude: 'Höhe', - speed: 'Geschwindigkeit', - course: 'Richtung', - address: 'Adresse' -}; \ No newline at end of file diff --git a/src/main/webapp/m/js/i18n/Messages_es.js b/src/main/webapp/m/js/i18n/Messages_es.js deleted file mode 100644 index 0e1cc4ba..00000000 --- a/src/main/webapp/m/js/i18n/Messages_es.js +++ /dev/null @@ -1,25 +0,0 @@ -var i18n = { - // login screen - username: 'Usuario', - password: 'Contraseña', - your_username: 'Your username', - your_password: 'Your password', - sign_in: 'Entrar', - user_name_and_password_must_not_be_empty: 'Nombre de usuario y contraseña no deben de estar vacios', - user_name_or_password_is_invalid: 'Nombre de usuario o contraseña invalido', - unexpected_error: 'Unexpected error', - open_desktop_version: 'Open Desktop version', - // sidebar - devices: 'Dispositivos', - logout: 'Cerrar sesión', - // device details - select_on_map: 'Select on map', - no_data_available: 'No data available', - time: 'Hora', - latitude: 'Latitud', - longitude: 'Longitud', - altitude: 'Altura', - speed: 'Velocidad', - course: 'Curso', - address: 'Dirección' -}; \ No newline at end of file diff --git a/src/main/webapp/m/js/i18n/Messages_hu.js b/src/main/webapp/m/js/i18n/Messages_hu.js deleted file mode 100644 index bacb4b76..00000000 --- a/src/main/webapp/m/js/i18n/Messages_hu.js +++ /dev/null @@ -1,25 +0,0 @@ -var i18n = { - // login screen - username: 'Felhasználó', - password: 'Jelszó', - your_username: 'Your username', - your_password: 'Your password', - sign_in: 'Bejelentkezés', - user_name_and_password_must_not_be_empty: 'Felhasználónév és a jelszó mező nem lehet üres!', - user_name_or_password_is_invalid: 'Felhasználónév vagy a jelszó nem megfelelő!', - unexpected_error: 'Unexpected error', - open_desktop_version: 'Open Desktop version', - // sidebar - devices: 'Eszközök', - logout: 'Kijelentkezés', - // device details - select_on_map: 'Select on map', - no_data_available: 'No data available', - time: 'Idő', - latitude: 'Szélesség', - longitude: 'Hosszúság', - altitude: 'Magasság', - speed: 'Sebesség', - course: 'Irány', - address: 'Cím' -}; \ No newline at end of file diff --git a/src/main/webapp/m/js/i18n/Messages_it.js b/src/main/webapp/m/js/i18n/Messages_it.js deleted file mode 100644 index 010e68ca..00000000 --- a/src/main/webapp/m/js/i18n/Messages_it.js +++ /dev/null @@ -1,25 +0,0 @@ -var i18n = { - // login screen - username: 'Utente', - password: 'Password', - your_username: 'Your username', - your_password: 'Your password', - sign_in: 'Login', - user_name_and_password_must_not_be_empty: 'Nome Utente e Password non possono essere vuoti', - user_name_or_password_is_invalid: 'Nome Utente e Password non sono validi', - unexpected_error: 'Unexpected error', - open_desktop_version: 'Open Desktop version', - // sidebar - devices: 'Dispositivi', - logout: 'Chiudi Sessione', - // device details - select_on_map: 'Select on map', - no_data_available: 'No data available', - time: 'Ora', - latitude: 'Latitudine', - longitude: 'Longitudine', - altitude: 'Altitudine', - speed: 'Velocità', - course: 'Percorso', - address: 'Indirizzo' -}; \ No newline at end of file diff --git a/src/main/webapp/m/js/i18n/Messages_lt.js b/src/main/webapp/m/js/i18n/Messages_lt.js deleted file mode 100644 index bc3d13e3..00000000 --- a/src/main/webapp/m/js/i18n/Messages_lt.js +++ /dev/null @@ -1,25 +0,0 @@ -var i18n = { - // login screen - username: 'Vardas', - password: 'Slaptažodis', - your_username: 'Your username', - your_password: 'Your password', - sign_in: 'Prisijungti', - user_name_and_password_must_not_be_empty: 'Vardas ir slaptažodis negali būti tušti', - user_name_or_password_is_invalid: 'Vardas arba slaptažodis klaidingi', - unexpected_error: 'Unexpected error', - open_desktop_version: 'Open Desktop version', - // sidebar - devices: 'Įrenginiai', - logout: 'Atsijungti', - // device details - select_on_map: 'Select on map', - no_data_available: 'No data available', - time: 'Laikas', - latitude: 'Platuma', - longitude: 'Ilguma', - altitude: 'Aukštis', - speed: 'Greitis', - course: 'Kursas', - address: 'Adresas' -}; \ No newline at end of file diff --git a/src/main/webapp/m/js/i18n/Messages_nl.js b/src/main/webapp/m/js/i18n/Messages_nl.js deleted file mode 100644 index 21df3d41..00000000 --- a/src/main/webapp/m/js/i18n/Messages_nl.js +++ /dev/null @@ -1,25 +0,0 @@ -var i18n = { - // login screen - username: 'Gebruiker', - password: 'Wachtwoord', - your_username: 'Your username', - your_password: 'Your password', - sign_in: 'Inloggen', - user_name_and_password_must_not_be_empty: 'Gebruikersnaam en wachtwoord mogen niet leeg zijn', - user_name_or_password_is_invalid: 'Gebruikersnaam en wachtwoord zijn incorrect', - unexpected_error: 'Unexpected error', - open_desktop_version: 'Open Desktop version', - // sidebar - devices: 'Apparaten', - logout: 'Uitloggen', - // device details - select_on_map: 'Select on map', - no_data_available: 'No data available', - time: 'Tijd', - latitude: 'Breedtegraad', - longitude: 'Lengtegraad', - altitude: 'Hoogte', - speed: 'Snelheid', - course: 'Richting', - address: 'Adres' -}; \ No newline at end of file diff --git a/src/main/webapp/m/js/i18n/Messages_pl.js b/src/main/webapp/m/js/i18n/Messages_pl.js deleted file mode 100644 index 89b03996..00000000 --- a/src/main/webapp/m/js/i18n/Messages_pl.js +++ /dev/null @@ -1,25 +0,0 @@ -var i18n = { - // login screen - username: 'U\u017Cytkownik', - password: 'Has\u0142o', - your_username: 'Your username', - your_password: 'Your password', - sign_in: 'Zaloguj', - user_name_and_password_must_not_be_empty: 'Nazwa u\u017Cytkownika lub has\u0142o nie mog\u0105 by\u0107 puste!', - user_name_or_password_is_invalid: 'Nazwa u\u017Cytkownika lub has\u0142o s\u0105 niepoprawne!', - unexpected_error: 'Unexpected error', - open_desktop_version: 'Open Desktop version', - // sidebar - devices: 'Urz\u0105dzenia (pojazdy)', - logout: 'Wyloguj', - // device details - select_on_map: 'Select on map', - no_data_available: 'No data available', - time: 'Czas', - latitude: 'Szeroko\u015B\u0107', - longitude: 'D\u0142ugo\u015B\u0107', - altitude: 'Wysoko\u015B\u0107', - speed: 'Pr\u0119dko\u015B\u0107', - course: 'Kierunek', - address: 'Adres' -}; \ No newline at end of file diff --git a/src/main/webapp/m/js/i18n/Messages_pt_PT.js b/src/main/webapp/m/js/i18n/Messages_pt_PT.js deleted file mode 100644 index 3470eb6c..00000000 --- a/src/main/webapp/m/js/i18n/Messages_pt_PT.js +++ /dev/null @@ -1,25 +0,0 @@ -var i18n = { - // login screen - username: 'Utilizador', - password: 'Palavra-passe', - your_username: 'Your username', - your_password: 'Your password', - sign_in: 'Aceder', - user_name_and_password_must_not_be_empty: 'Utilizador e palavra-passe não podem ser vazios', - user_name_or_password_is_invalid: 'Utilizador ou palavra-passe inválidos', - unexpected_error: 'Unexpected error', - open_desktop_version: 'Open Desktop version', - // sidebar - devices: 'Dispositivos', - logout: 'Sair', - // device details - select_on_map: 'Select on map', - no_data_available: 'No data available', - time: 'Hora', - latitude: 'Latitude', - longitude: 'Longitude', - altitude: 'Altitude', - speed: 'Velocidade', - course: 'Rota', - address: 'Morada' -}; \ No newline at end of file diff --git a/src/main/webapp/m/js/i18n/Messages_ru.js b/src/main/webapp/m/js/i18n/Messages_ru.js deleted file mode 100644 index 67dae9bc..00000000 --- a/src/main/webapp/m/js/i18n/Messages_ru.js +++ /dev/null @@ -1,25 +0,0 @@ -var i18n = { - // login screen - username: 'Имя пользователя', - password: 'Пароль', - your_username: 'Ваше имя пользователя', - your_password: 'Ваш пароль', - sign_in: 'Войти', - user_name_and_password_must_not_be_empty: 'Имя пользователя и пароль должны быть заполнены', - user_name_or_password_is_invalid: 'Неправильное имя пользователя или пароль', - unexpected_error: 'Неизвестная ошибка', - open_desktop_version: 'Открыть полную версию', - // sidebar - devices: 'Устройства', - logout: 'Выйти', - // device details - select_on_map: 'Выбрать на карте', - no_data_available: 'Нет данных', - time: 'Время', - latitude: 'Широта', - longitude: 'Долгота', - altitude: 'Высота', - speed: 'Скорость', - course: 'Курс', - address: 'Адрес' -}; \ No newline at end of file diff --git a/src/main/webapp/m/js/i18n/Messages_tl.js b/src/main/webapp/m/js/i18n/Messages_tl.js deleted file mode 100644 index 1f3e66ce..00000000 --- a/src/main/webapp/m/js/i18n/Messages_tl.js +++ /dev/null @@ -1,25 +0,0 @@ -var i18n = { - // login screen - username: 'Username', - password: 'Password', - your_username: 'Your username', - your_password: 'Your password', - sign_in: 'Sign In', - user_name_and_password_must_not_be_empty: 'User name and password must not be empty', - user_name_or_password_is_invalid: 'User name or password is invalid', - unexpected_error: 'Unexpected error', - open_desktop_version: 'Open Desktop version', - // sidebar - devices: 'Devices', - logout: 'Logout', - // device details - select_on_map: 'Select on map', - no_data_available: 'No data available', - time: 'Time', - latitude: 'Latitude', - longitude: 'Longitude', - altitude: 'Altitude', - speed: 'Speed', - course: 'Course', - address: 'Address' -}; \ No newline at end of file diff --git a/src/main/webapp/m/js/traccar-mobile.js b/src/main/webapp/m/js/traccar-mobile.js index f3e65e62..e59c9805 100644 --- a/src/main/webapp/m/js/traccar-mobile.js +++ b/src/main/webapp/m/js/traccar-mobile.js @@ -1,3 +1,13 @@ +// set up locale +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"); + results = regex.exec(location.search); + return results === null ? null : decodeURIComponent(results[1].replace(/\+/g, " ")); +} +var locale = getParameterByName("locale"); +i18n = i18n[locale === null ? 'en' : locale]; + // Initialize app var myApp = new Framework7({ modalTitle: '', @@ -73,16 +83,13 @@ myApp.onPageInit('login-screen', function (page) { pageContainer.find('#form-login').trigger('submit'); }); - var locale = getParameterByName('locale'); var language = pageContainer.find('#language'); - if (locale != null) { - var sel = language[0]; - var opts = sel.options; - for(var j = 0; j < opts.length; j++) { - if (opts[j].value == locale) { - sel.selectedIndex = j; - break; - } + var sel = language[0]; + var opts = sel.options; + for(var j = 0; j < opts.length; j++) { + if (opts[j].value == locale) { + sel.selectedIndex = j; + break; } } @@ -95,7 +102,6 @@ myApp.onPageInit('login-screen', function (page) { // set up open desktop version action pageContainer.find('.open-desktop-version').on('click', function() { - var locale = getParameterByName('locale'); window.location = '/?' + (locale == null ? '' : 'locale=' + locale + '&') + 'nomobileredirect=1'; }); @@ -354,7 +360,7 @@ function loadDevices() { // set up open desktop version action $$('.open-desktop-version').on('click', function() { - window.location = '/?nomobileredirect=1'; + window.location = '/?' + (locale == null ? '' : 'locale=' + locale + '&') + 'nomobileredirect=1'; }); }, error: function() { diff --git a/src/main/webapp/m/pages/login.html b/src/main/webapp/m/pages/login.html index ca126aca..1144bef3 100644 --- a/src/main/webapp/m/pages/login.html +++ b/src/main/webapp/m/pages/login.html @@ -52,7 +52,7 @@
-

{{i18n.open_desktop_version}}

+

{{i18n.open_desktop_version}}