X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/248b5fa1aefb8c7b4ece818ad3720992f2487fe2..e2e61692ea04fc156221082aeddc21ea18facdec:/app/assets/javascripts/application.js diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index c8f188a2e..5c61b01cc 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -19,14 +19,15 @@ const application_data = $("head").data(); const locale = application_data.locale; - I18n.default_locale = OSM.DEFAULT_LOCALE; - I18n.locale = locale; - I18n.fallbacks = true; + OSM.i18n = I18n; + + 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; @@ -198,5 +199,5 @@ $(function () { }); $("#edit_tab") - .attr("title", I18n.t("javascripts.site.edit_disabled_tooltip")); + .attr("title", OSM.i18n.t("javascripts.site.edit_disabled_tooltip")); });