Skip to content

Commit

Permalink
For #26 - moved translations to same javascript file to be loaded syn…
Browse files Browse the repository at this point in the history
…chronously
  • Loading branch information
vitalidze committed Mar 9, 2015
1 parent 486fb3d commit ebbb69b
Show file tree
Hide file tree
Showing 14 changed files with 306 additions and 308 deletions.
25 changes: 2 additions & 23 deletions src/main/webapp/m/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,7 @@
<!-- OpenLayers -->
<link rel="stylesheet" href="http://openlayers.org/en/v3.0.0/css/ol.css" type="text/css">
<!-- i18n -->
<script type="text/javascript">
function loadJSfile(filename) {
var fileref = document.createElement('script');
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", filename);
if (typeof fileref != "undefined") {
document.getElementsByTagName("head")[0].appendChild(fileref)
return true;
}
return false;
}
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");
if (locale === null || !loadJSfile("js/i18n/Messages_" + locale + ".js")) {
loadJSfile("js/i18n/Messages.js");
}
</script>
<script type="text/javascript" src="js/i18n/Messages.js"></script>
</head>
<body>
<!-- Status bar overlay for full screen mode (PhoneGap) -->
Expand Down Expand Up @@ -78,7 +57,7 @@
</ul>
</div>
<div class="content-block">
<p><a href="/?nomobileredirect=1" class="button button-fill open-desktop-version">{{i18n.open_desktop_version}}</a></p>
<p><a href="#" class="button button-fill open-desktop-version">{{i18n.open_desktop_version}}</a></p>
<p><a href="#" id="logout" class="button button-fill color-red">{{i18n.logout}}</a></p>
</div>
</script>
Expand Down
309 changes: 286 additions & 23 deletions src/main/webapp/m/js/i18n/Messages.js
Original file line number Diff line number Diff line change
@@ -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'
}
};
25 changes: 0 additions & 25 deletions src/main/webapp/m/js/i18n/Messages_de.js

This file was deleted.

Loading

0 comments on commit ebbb69b

Please sign in to comment.