X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/84fc41716298c24e7ed2ce5d96d4abe9c75fe94b..e2e61692ea04fc156221082aeddc21ea18facdec:/app/assets/javascripts/application.js diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 4991e82fb..5c61b01cc 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -19,13 +19,15 @@ const application_data = $("head").data(); const locale = application_data.locale; - I18n.default_locale = OSM.DEFAULT_LOCALE; - I18n.locale = locale; + 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; @@ -197,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")); });