translate via i18next

This commit is contained in:
Gautier Pelloux-Prayer 2019-02-24 10:21:54 +01:00
parent a8c9bf0c6d
commit f54d72644b
20 changed files with 1410 additions and 155 deletions

View file

@ -25,10 +25,13 @@ BR.Layers = L.Class.extend({
info: false,
searching: false,
paging: false,
language: {
emptyTable: i18next.t("sidebar.layers.table.empty")
},
columns: [
{ title: "Name" },
{ title: "URL" },
{ title: "Type" }
{ title: i18next.t("sidebar.layers.table.name") },
{ title: i18next.t("sidebar.layers.table.URL") },
{ title: i18next.t("sidebar.layers.table.type") }
]
});
},

View file

@ -37,7 +37,7 @@ BR.Message = L.Class.extend({
showError: function (err) {
if (err == 'Error: target island detected for section 0\n') {
err = 'Error: cannot find a route for given points. Maybe try to move them closer to roads?';
err = i18next.t('warning.no-route-found');
}
this._show(err, 'error');
},

View file

@ -28,7 +28,7 @@ BR.OpacitySlider = L.Control.extend({
};
$(container).html(input);
$(container).attr('title', 'Set transparency of route track and markers');
$(container).attr('title', i18next.t('map.opacity-slider'));
input.slider({
min: 0,

View file

@ -9,7 +9,7 @@ BR.RoutingOptions = L.Evented.extend({
for (var i = 0; i < profiles.length; i++) {
var option = document.createElement("option");
option.value = profiles[i];
option.text = profiles[i];
option.text = i18next.t("navbar.profile." + profiles[i]);
profiles_list.appendChild(option);
}
// set default value, used as indicator for empty custom profile