OSM.i18n = I18n;
- I18n.default_locale = OSM.DEFAULT_LOCALE;
- I18n.locale = locale;
+ OSM.i18n.default_locale = OSM.DEFAULT_LOCALE;
+ OSM.i18n.locale = locale;
// '-' are replaced with '_' in https://github.com/eemeli/make-plural/tree/main/packages/plurals
const pluralizer = plurals[locale.replace(/\W+/g, "_")] || plurals[locale.split("-")[0]];
if (pluralizer) {
- I18n.pluralization[locale] = (count) => [pluralizer(count), "other"];
+ OSM.i18n.pluralization[locale] = (count) => [pluralizer(count), "other"];
}
OSM.preferred_editor = application_data.preferredEditor;
});
$("#edit_tab")
- .attr("title", I18n.t("javascripts.site.edit_disabled_tooltip"));
+ .attr("title", OSM.i18n.t("javascripts.site.edit_disabled_tooltip"));
});
}
marker = L.marker(e.latlng, { icon: OSM.getUserIcon() }).addTo(map)
- .bindPopup(I18n.t("diary_entries.edit.marker_text"));
+ .bindPopup(OSM.i18n.t("diary_entries.edit.marker_text"));
}
$("#usemap").click(function (e) {
if ($("#latitude").val() && $("#longitude").val()) {
marker = L.marker(centre, { icon: OSM.getUserIcon() }).addTo(map)
- .bindPopup(I18n.t("diary_entries.edit.marker_text"));
+ .bindPopup(OSM.i18n.t("diary_entries.edit.marker_text"));
}
map.on("click", setLocation);
if (!idData.configured) {
// eslint-disable-next-line no-alert
- alert(I18n.t("site.edit.id_not_configured"));
+ alert(OSM.i18n.t("site.edit.id_not_configured"));
return;
}
const OSM = { i18n: I18n };
if (navigator.languages) {
- I18n.locale = navigator.languages[0];
+ OSM.i18n.locale = navigator.languages[0];
} else if (navigator.language) {
- I18n.locale = navigator.language;
+ OSM.i18n.locale = navigator.language;
}
-I18n.default_locale = <%= I18n.default_locale.to_json %>;
-I18n.fallbacks = true;
+OSM.i18n.default_locale = <%= I18n.default_locale.to_json %>;
+OSM.i18n.fallbacks = true;
window.onload = function () {
const args = Object.fromEntries(new URLSearchParams(location.search));
L.Control.OSMReportAProblem = L.Control.Attribution.extend({
options: {
position: "bottomright",
- prefix: `<a href="https://www.openstreetmap.org/fixthemap?lat={x}&lon={y}&zoom={z}" target="_blank">${I18n.t("javascripts.embed.report_problem")}</a>`
+ prefix: `<a href="https://www.openstreetmap.org/fixthemap?lat={x}&lon={y}&zoom={z}" target="_blank">${OSM.i18n.t("javascripts.embed.report_problem")}</a>`
},
onAdd: function (map) {
const colorScheme = document.documentElement.getAttribute("data-bs-theme") ?? "auto";
const rangeColors = ["#14432a", "#166b34", "#37a446", "#4dd05a"];
const startDate = new Date(Date.now() - (365 * 24 * 60 * 60 * 1000));
- const monthNames = I18n.t("date.abbr_month_names");
+ const monthNames = OSM.i18n.t("date.abbr_month_names");
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
}
function getTooltipText(date, value) {
- const localizedDate = I18n.l("date.formats.long", date);
+ const localizedDate = OSM.i18n.l("date.formats.long", date);
if (value > 0) {
- return I18n.t("javascripts.heatmap.tooltip.contributions", { count: value, date: localizedDate });
+ return OSM.i18n.t("javascripts.heatmap.tooltip.contributions", { count: value, date: localizedDate });
}
- return I18n.t("javascripts.heatmap.tooltip.no_contributions", { date: localizedDate });
+ return OSM.i18n.t("javascripts.heatmap.tooltip.no_contributions", { date: localizedDate });
}
function getTheme() {
})
.catch(() => {
// eslint-disable-next-line no-alert
- alert(I18n.t("site.index.remote_failed"));
+ alert(OSM.i18n.t("site.index.remote_failed"));
});
function sendRemoteEditCommand(url) {
.removeAttr("title")
.tooltip({
placement: "bottom",
- title: I18n.t("javascripts.edit_help")
+ title: OSM.i18n.t("javascripts.edit_help")
})
.tooltip("show");
page.pushstate = page.popstate = function () {
map.setSidebarOverlaid(true);
- document.title = I18n.t("layouts.project_name.title");
+ document.title = OSM.i18n.t("layouts.project_name.title");
};
page.load = function () {
OSM.initializeContextMenu = function (map) {
map.contextmenu.addItem({
- text: I18n.t("javascripts.context.directions_from"),
+ text: OSM.i18n.t("javascripts.context.directions_from"),
callback: function directionsFromHere(e) {
const latlng = OSM.cropLocation(e.latlng, map.getZoom());
});
map.contextmenu.addItem({
- text: I18n.t("javascripts.context.directions_to"),
+ text: OSM.i18n.t("javascripts.context.directions_to"),
callback: function directionsToHere(e) {
const latlng = OSM.cropLocation(e.latlng, map.getZoom());
});
map.contextmenu.addItem({
- text: I18n.t("javascripts.context.add_note"),
+ text: OSM.i18n.t("javascripts.context.add_note"),
callback: function addNoteHere(e) {
const [lat, lon] = OSM.cropLocation(e.latlng, map.getZoom());
});
map.contextmenu.addItem({
- text: I18n.t("javascripts.context.show_address"),
+ text: OSM.i18n.t("javascripts.context.show_address"),
callback: function describeLocation(e) {
const [lat, lon] = OSM.cropLocation(e.latlng, map.getZoom());
});
map.contextmenu.addItem({
- text: I18n.t("javascripts.context.query_features"),
+ text: OSM.i18n.t("javascripts.context.query_features"),
callback: function queryFeatures(e) {
const [lat, lon] = OSM.cropLocation(e.latlng, map.getZoom());
});
map.contextmenu.addItem({
- text: I18n.t("javascripts.context.centre_map"),
+ text: OSM.i18n.t("javascripts.context.centre_map"),
callback: function centreMap(e) {
map.panTo(e.latlng);
}
if (json.length === 0) {
input.addClass("is-invalid");
// eslint-disable-next-line no-alert
- alert(I18n.t("javascripts.directions.errors.no_place", { place: endpoint.value }));
+ alert(OSM.i18n.t("javascripts.directions.errors.no_place", { place: endpoint.value }));
return;
}
function formatTotalDistance(m) {
if (m < 1000) {
- return I18n.t("javascripts.directions.distance_m", { distance: Math.round(m) });
+ return OSM.i18n.t("javascripts.directions.distance_m", { distance: Math.round(m) });
} else if (m < 10000) {
- return I18n.t("javascripts.directions.distance_km", { distance: (m / 1000.0).toFixed(1) });
+ return OSM.i18n.t("javascripts.directions.distance_km", { distance: (m / 1000.0).toFixed(1) });
} else {
- return I18n.t("javascripts.directions.distance_km", { distance: Math.round(m / 1000) });
+ return OSM.i18n.t("javascripts.directions.distance_km", { distance: Math.round(m / 1000) });
}
}
if (m < 5) {
return "";
} else if (m < 200) {
- return I18n.t("javascripts.directions.distance_m", { distance: String(Math.round(m / 10) * 10) });
+ return OSM.i18n.t("javascripts.directions.distance_m", { distance: String(Math.round(m / 10) * 10) });
} else if (m < 1500) {
- return I18n.t("javascripts.directions.distance_m", { distance: String(Math.round(m / 100) * 100) });
+ return OSM.i18n.t("javascripts.directions.distance_m", { distance: String(Math.round(m / 100) * 100) });
} else if (m < 5000) {
- return I18n.t("javascripts.directions.distance_km", { distance: String(Math.round(m / 100) / 10) });
+ return OSM.i18n.t("javascripts.directions.distance_km", { distance: String(Math.round(m / 100) / 10) });
} else {
- return I18n.t("javascripts.directions.distance_km", { distance: String(Math.round(m / 1000)) });
+ return OSM.i18n.t("javascripts.directions.distance_km", { distance: String(Math.round(m / 1000)) });
}
}
function formatHeight(m) {
- return I18n.t("javascripts.directions.distance_m", { distance: Math.round(m) });
+ return OSM.i18n.t("javascripts.directions.distance_m", { distance: Math.round(m) });
}
function formatTime(s) {
}
const distanceText = $("<p>").append(
- I18n.t("javascripts.directions.distance") + ": " + formatTotalDistance(route.distance) + ". " +
- I18n.t("javascripts.directions.time") + ": " + formatTime(route.time) + ".");
+ OSM.i18n.t("javascripts.directions.distance") + ": " + formatTotalDistance(route.distance) + ". " +
+ OSM.i18n.t("javascripts.directions.time") + ": " + formatTime(route.time) + ".");
if (typeof route.ascend !== "undefined" && typeof route.descend !== "undefined") {
distanceText.append(
$("<br>"),
- I18n.t("javascripts.directions.ascend") + ": " + formatHeight(route.ascend) + ". " +
- I18n.t("javascripts.directions.descend") + ": " + formatHeight(route.descend) + ".");
+ OSM.i18n.t("javascripts.directions.ascend") + ": " + formatHeight(route.ascend) + ". " +
+ OSM.i18n.t("javascripts.directions.descend") + ": " + formatHeight(route.descend) + ".");
}
const turnByTurnTable = $("<table class='table table-hover table-sm mb-3'>")
downloadURL = URL.createObjectURL(blob);
$("#directions_content").append(`<p class="text-center"><a href="${downloadURL}" download="${
- I18n.t("javascripts.directions.filename")
+ OSM.i18n.t("javascripts.directions.filename")
}">${
- I18n.t("javascripts.directions.download")
+ OSM.i18n.t("javascripts.directions.download")
}</a></p>`);
$("#directions_content").append("<p class=\"text-center\">" +
- I18n.t("javascripts.directions.instructions.courtesy", { link: chosenEngine.creditline }) +
+ OSM.i18n.t("javascripts.directions.instructions.courtesy", { link: chosenEngine.creditline }) +
"</p>");
}).catch(function () {
map.removeLayer(polyline);
if (reportErrors) {
- $("#directions_content").html("<div class=\"alert alert-danger\">" + I18n.t("javascripts.directions.errors.no_route") + "</div>");
+ $("#directions_content").html("<div class=\"alert alert-danger\">" + OSM.i18n.t("javascripts.directions.errors.no_route") + "</div>");
}
}).finally(function () {
controller = null;
} else if (step.ref) {
name = "<b>" + step.ref + "</b>";
} else {
- name = I18n.t(instrPrefix + "unnamed");
+ name = OSM.i18n.t(instrPrefix + "unnamed");
namedRoad = false;
}
if (step.maneuver.type.match(/^exit (rotary|roundabout)$/)) {
- instText += I18n.t(template, { name: name });
+ instText += OSM.i18n.t(template, { name: name });
} else if (step.maneuver.type.match(/^(rotary|roundabout)$/)) {
if (step.maneuver.exit) {
if (step.maneuver.exit <= 10) {
- instText += I18n.t(template + "_with_exit_ordinal", { exit: I18n.t(instrPrefix + "exit_counts." + numToWord(step.maneuver.exit)), name: name });
+ instText += OSM.i18n.t(template + "_with_exit_ordinal", { exit: OSM.i18n.t(instrPrefix + "exit_counts." + numToWord(step.maneuver.exit)), name: name });
} else {
- instText += I18n.t(template + "_with_exit", { exit: step.maneuver.exit, name: name });
+ instText += OSM.i18n.t(template + "_with_exit", { exit: step.maneuver.exit, name: name });
}
} else {
- instText += I18n.t(template + "_without_exit", { name: name });
+ instText += OSM.i18n.t(template + "_without_exit", { name: name });
}
} else if (step.maneuver.type.match(/^(on ramp|off ramp)$/)) {
const params = {};
if (Object.keys(params).length > 0) {
template = template + "_with_" + Object.keys(params).join("_");
}
- instText += I18n.t(template, params);
+ instText += OSM.i18n.t(template, params);
} else {
- instText += I18n.t(template + "_without_exit", { name: name });
+ instText += OSM.i18n.t(template + "_without_exit", { name: name });
}
return [[step.maneuver.location[1], step.maneuver.location[0]], ICON_MAP[maneuver_id], instText, step.distance, step_geometry];
})
costing: costing,
directions_options: {
units: "km",
- language: I18n.currentLocale()
+ language: OSM.i18n.currentLocale()
}
})
});
// https://graphhopper.com/api/1/docs/routing/
const query = new URLSearchParams({
vehicle: vehicleType,
- locale: I18n.currentLocale(),
+ locale: OSM.i18n.currentLocale(),
key: "LijBPDQGfu7Iiq80w3HzwB4RUDJbMbhs6BU0dEnn",
elevation: false,
instructions: true,
});
marker = L.marker(OSM.home, {
icon: OSM.getUserIcon(),
- title: I18n.t("javascripts.home.marker_title")
+ title: OSM.i18n.t("javascripts.home.marker_title")
}).addTo(map);
} else {
$("#browse_status").html(
$("<div class='m-2 alert alert-warning'>").text(
- I18n.t("javascripts.home.not_set")
+ OSM.i18n.t("javascripts.home.not_set")
)
);
}
$("<div class='p-3'>").append(
$("<div class='d-flex'>").append(
$("<h2 class='flex-grow-1 text-break'>")
- .text(I18n.t("browse.start_rjs.load_data")),
+ .text(OSM.i18n.t("browse.start_rjs.load_data")),
$("<div>").append(
$("<button type='button' class='btn-close'>")
- .attr("aria-label", I18n.t("javascripts.close"))
+ .attr("aria-label", OSM.i18n.t("javascripts.close"))
.click(cancel))),
$("<p class='alert alert-warning'>")
- .text(I18n.t("browse.start_rjs.feature_warning", { num_features })),
+ .text(OSM.i18n.t("browse.start_rjs.feature_warning", { num_features })),
$("<input type='submit' class='btn btn-primary d-block mx-auto'>")
- .val(I18n.t("browse.start_rjs.load_data"))
+ .val(OSM.i18n.t("browse.start_rjs.load_data"))
.click(add)));
}
$("<div class='p-3'>").append(
$("<div class='d-flex'>").append(
$("<h2 class='flex-grow-1 text-break'>")
- .text(I18n.t("browse.start_rjs.load_data")),
+ .text(OSM.i18n.t("browse.start_rjs.load_data")),
$("<div>").append(
$("<button type='button' class='btn-close'>")
- .attr("aria-label", I18n.t("javascripts.close"))
+ .attr("aria-label", OSM.i18n.t("javascripts.close"))
.click(close))),
$("<p class='alert alert-warning'>")
- .text(I18n.t("browse.start_rjs.feature_error", { message: message }))));
+ .text(OSM.i18n.t("browse.start_rjs.feature_error", { message: message }))));
}
function getData() {
.attr("id", "layers-data-loading")
.attr("class", "spinner-border spinner-border-sm ms-1")
.attr("role", "status")
- .html("<span class='visually-hidden'>" + I18n.t("browse.start_rjs.loading") + "</span>")
+ .html("<span class='visually-hidden'>" + OSM.i18n.t("browse.start_rjs.loading") + "</span>")
.appendTo($("#label-layers-data"));
dataLoader = new AbortController();
let prefix = "";
if (tags.boundary === "administrative" && (tags.border_type || tags.admin_level)) {
- prefix = I18n.t("geocoder.search_osm_nominatim.border_types." + tags.border_type, {
- defaultValue: I18n.t("geocoder.search_osm_nominatim.admin_levels.level" + tags.admin_level, {
- defaultValue: I18n.t("geocoder.search_osm_nominatim.prefix.boundary.administrative")
+ prefix = OSM.i18n.t("geocoder.search_osm_nominatim.border_types." + tags.border_type, {
+ defaultValue: OSM.i18n.t("geocoder.search_osm_nominatim.admin_levels.level" + tags.admin_level, {
+ defaultValue: OSM.i18n.t("geocoder.search_osm_nominatim.prefix.boundary.administrative")
})
});
} else {
- const prefixes = I18n.t("geocoder.search_osm_nominatim.prefix");
+ const prefixes = OSM.i18n.t("geocoder.search_osm_nominatim.prefix");
for (const key in tags) {
const value = tags[key];
}
if (!prefix) {
- prefix = I18n.t("javascripts.query." + feature.type);
+ prefix = OSM.i18n.t("javascripts.query." + feature.type);
}
return prefix;
if (results.remark) {
$("<li>")
.addClass("list-group-item")
- .text(I18n.t("javascripts.query.error", { server: url, error: results.remark }))
+ .text(OSM.i18n.t("javascripts.query.error", { server: url, error: results.remark }))
.appendTo($ul);
}
if ($ul.find("li").length === 0) {
$("<li>")
.addClass("list-group-item")
- .text(I18n.t("javascripts.query.nothing_found"))
+ .text(OSM.i18n.t("javascripts.query.nothing_found"))
.appendTo($ul);
}
})
$("<li>")
.addClass("list-group-item")
- .text(I18n.t("javascripts.query.error", { server: url, error: error.message }))
+ .text(OSM.i18n.t("javascripts.query.error", { server: url, error: error.message }))
.appendTo($ul);
});
}
button
.toggleClass("disabled", disabled)
.attr("data-bs-original-title",
- I18n.t(disabled ?
+ OSM.i18n.t(disabled ?
"javascripts.key.tooltip_disabled" :
"javascripts.key.tooltip"));
}
.appendTo($ui);
$("<p>")
- .text(I18n.t("javascripts.map.layers.overlays"))
+ .text(OSM.i18n.t("javascripts.map.layers.overlays"))
.attr("class", "text-body-secondary small mb-2")
.appendTo(overlaySection);
if (name === "notes" || name === "data") {
item
- .attr("title", I18n.t("javascripts.site.map_" + name + "_zoom_in_tooltip"))
+ .attr("title", OSM.i18n.t("javascripts.site.map_" + name + "_zoom_in_tooltip"))
.tooltip("disable");
}
.prop("checked", checked)
.appendTo(label);
- label.append(I18n.t("javascripts.map.layers." + name));
+ label.append(OSM.i18n.t("javascripts.map.layers." + name));
input.on("change", function () {
checked = input.is(":checked");
icon: "icon geolocate",
iconLoading: "icon geolocate",
strings: {
- title: I18n.t("javascripts.map.locate.title"),
+ title: OSM.i18n.t("javascripts.map.locate.title"),
popup: function (options) {
- return I18n.t("javascripts.map.locate." + options.unit + "Popup", { count: options.distance });
+ return OSM.i18n.t("javascripts.map.locate." + options.unit + "Popup", { count: options.distance });
}
},
...options
if (property === "credit") {
layerOptions.attribution = makeAttribution(value);
} else if (property === "nameId") {
- layerOptions.name = I18n.t(`javascripts.map.base.${value}`);
+ layerOptions.name = OSM.i18n.t(`javascripts.map.base.${value}`);
} else if (property === "leafletOsmId") {
layerConstructor = L.OSM[value];
} else if (property === "leafletOsmDarkId" && OSM.isDarkMap() && L.OSM[value]) {
function makeAttribution(credit) {
let attribution = "";
- attribution += I18n.t("javascripts.map.copyright_text", {
+ attribution += OSM.i18n.t("javascripts.map.copyright_text", {
copyright_link: $("<a>", {
href: "/copyright",
- text: I18n.t("javascripts.map.openstreetmap_contributors")
+ text: OSM.i18n.t("javascripts.map.openstreetmap_contributors")
}).prop("outerHTML")
});
attribution += $("<a>", {
href: "https://wiki.osmfoundation.org/wiki/Terms_of_Use",
- text: I18n.t("javascripts.map.website_and_api_terms")
+ text: OSM.i18n.t("javascripts.map.website_and_api_terms")
}).prop("outerHTML");
return attribution;
for (const childId in credit.children) {
children[childId] = makeCredit(credit.children[childId]);
}
- const text = I18n.t(`javascripts.map.${credit.id}`, children);
+ const text = OSM.i18n.t(`javascripts.map.${credit.id}`, children);
if (credit.href) {
const link = $("<a>", {
href: credit.href,
isDisabled = OSM.STATUS === "database_offline" || map.getZoom() < 12;
link
.toggleClass("disabled", isDisabled)
- .attr("data-bs-original-title", I18n.t(isDisabled ?
+ .attr("data-bs-original-title", OSM.i18n.t(isDisabled ?
"javascripts.site.createnote_disabled_tooltip" :
"javascripts.site.createnote_tooltip"));
if (isDisabled === wasDisabled) return;
isDisabled = map.getZoom() < 14;
link
.toggleClass("disabled", isDisabled)
- .attr("data-bs-original-title", I18n.t(isDisabled ?
+ .attr("data-bs-original-title", OSM.i18n.t(isDisabled ?
"javascripts.site.queryfeature_disabled_tooltip" :
"javascripts.site.queryfeature_tooltip"));
if (isDisabled === wasDisabled) return;
.appendTo($ui);
$("<h4>")
- .text(I18n.t("javascripts.share.link"))
+ .text(OSM.i18n.t("javascripts.share.link"))
.appendTo($linkSection);
let $form = $("<form>")
.append($("<label>")
.attr("for", "link_marker")
.attr("class", "form-check-label")
- .text(I18n.t("javascripts.share.include_marker")))
+ .text(OSM.i18n.t("javascripts.share.include_marker")))
.append($("<input>")
.attr("id", "link_marker")
.attr("type", "checkbox")
.addClass("active")
.attr("for", "long_input")
.attr("id", "long_link")
- .text(I18n.t("javascripts.share.long_link")))
+ .text(OSM.i18n.t("javascripts.share.long_link")))
.append($("<a class='btn btn-primary'>")
.attr("for", "short_input")
.attr("id", "short_link")
- .text(I18n.t("javascripts.share.short_link")))
+ .text(OSM.i18n.t("javascripts.share.short_link")))
.append($("<a class='btn btn-primary'>")
.attr("for", "embed_html")
.attr("id", "embed_link")
- .attr("data-bs-title", I18n.t("javascripts.site.embed_html_disabled"))
+ .attr("data-bs-title", OSM.i18n.t("javascripts.site.embed_html_disabled"))
.attr("href", "#")
- .text(I18n.t("javascripts.share.embed")))
+ .text(OSM.i18n.t("javascripts.share.embed")))
.on("click", "a", function (e) {
e.preventDefault();
if (!$(this).hasClass("btn-primary")) return;
.append(
$("<p>")
.attr("class", "text-body-secondary")
- .text(I18n.t("javascripts.share.paste_html")));
+ .text(OSM.i18n.t("javascripts.share.paste_html")));
// Geo URI
.appendTo($ui);
$("<h4>")
- .text(I18n.t("javascripts.share.geo_uri"))
+ .text(OSM.i18n.t("javascripts.share.geo_uri"))
.appendTo($geoUriSection);
$("<div>")
.appendTo($ui);
$("<h4>")
- .text(I18n.t("javascripts.share.image"))
+ .text(OSM.i18n.t("javascripts.share.image"))
.appendTo($imageSection);
$("<div>")
.attr("id", "export-warning")
.attr("class", "text-body-secondary")
- .text(I18n.t("javascripts.share.only_layers_exported_as_image"))
+ .text(OSM.i18n.t("javascripts.share.only_layers_exported_as_image"))
.append(
$("<ul>").append(
map.baseLayers
.append($("<label>")
.attr("for", "mapnik_format")
.attr("class", "col-auto col-form-label")
- .text(I18n.t("javascripts.share.format")))
+ .text(OSM.i18n.t("javascripts.share.format")))
.append($("<div>")
.attr("class", "col-auto")
.append($("<select>")
.append($("<label>")
.attr("for", "mapnik_scale")
.attr("class", "col-auto col-form-label")
- .text(I18n.t("javascripts.share.scale")))
+ .text(OSM.i18n.t("javascripts.share.scale")))
.append($("<div>")
.attr("class", "col-auto")
.append($("<div>")
.append($("<label>")
.attr("for", "image_filter")
.attr("class", "form-check-label")
- .text(I18n.t("javascripts.share.custom_dimensions")))
+ .text(OSM.i18n.t("javascripts.share.custom_dimensions")))
.append($("<input>")
.attr("id", "image_filter")
.attr("type", "checkbox")
$("<p>")
.attr("class", "text-body-secondary")
- .html(I18n.t("javascripts.share.image_dimensions", args))
+ .html(OSM.i18n.t("javascripts.share.image_dimensions", args))
.appendTo($form);
$("<input>")
.attr("type", "submit")
.attr("class", "btn btn-primary")
- .attr("value", I18n.t("javascripts.share.download"))
+ .attr("value", OSM.i18n.t("javascripts.share.download"))
.appendTo($form);
locationFilter
escapeHTML(OSM.SERVER_PROTOCOL + "://" + OSM.SERVER_URL + "/export/embed.html?" + params) +
"\" style=\"border: 1px solid black\"></iframe><br/>" +
"<small><a href=\"" + escapeHTML(map.getUrl(marker)) + "\">" +
- escapeHTML(I18n.t("javascripts.share.view_larger_map")) + "</a></small>");
+ escapeHTML(OSM.i18n.t("javascripts.share.view_larger_map")) + "</a></small>");
// Geo URI
.on("click", toggle);
if (buttonTitle) {
- button.attr("title", I18n.t(buttonTitle));
+ button.attr("title", OSM.i18n.t(buttonTitle));
}
button.appendTo($container);
.attr("class", `${uiClass}-ui position-relative z-n1`);
$("<h2 class='p-3 pb-0 pe-5 text-break'>")
- .text(I18n.t(paneTitle))
+ .text(OSM.i18n.t(paneTitle))
.appendTo($ui);
options.sidebar.addPane($ui);
this._map = map;
this._zoomInButton = this._createButton(
- "", I18n.t("javascripts.map.zoom.in"), zoomName + "in", container, this._zoomIn, this);
+ "", OSM.i18n.t("javascripts.map.zoom.in"), zoomName + "in", container, this._zoomIn, this);
this._zoomOutButton = this._createButton(
- "", I18n.t("javascripts.map.zoom.out"), zoomName + "out", container, this._zoomOut, this);
+ "", OSM.i18n.t("javascripts.map.zoom.out"), zoomName + "out", container, this._zoomOut, this);
map.on("zoomend zoomlevelschange", this._updateDisabled, this);
icon: "icon geolocate",
iconLoading: "icon geolocate",
strings: {
- title: I18n.t("javascripts.map.locate.title"),
+ title: OSM.i18n.t("javascripts.map.locate.title"),
popup: function (options) {
- return I18n.t("javascripts.map.locate." + options.unit + "Popup", { count: options.distance });
+ return OSM.i18n.t("javascripts.map.locate." + options.unit + "Popup", { count: options.distance });
}
}
}).addTo(map);
});
$("input[name=legale]").change(function () {
- $("#contributorTerms").html("<div class='spinner-border' role='status'><span class='visually-hidden'>" + I18n.t("browse.start_rjs.loading") + "</span></div>");
+ $("#contributorTerms").html("<div class='spinner-border' role='status'><span class='visually-hidden'>" + OSM.i18n.t("browse.start_rjs.loading") + "</span></div>");
fetch($(this).data("url"))
.then(r => r.text())
.then(html => { $("#contributorTerms").html(html); });