]> git.openstreetmap.org Git - rails.git/commitdiff
Add OSM.i18n as an alias for I18n
authorTom Hughes <tom@compton.nu>
Sun, 16 Mar 2025 18:44:35 +0000 (18:44 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 17 Mar 2025 17:18:37 +0000 (17:18 +0000)
app/assets/javascripts/application.js
app/assets/javascripts/embed.js.erb

index 4991e82fb71d2170ec36b75fb6eded434bc23d97..c01a0f14baf26dbc030b5b78dcab446e418af162 100644 (file)
@@ -19,6 +19,8 @@
   const application_data = $("head").data();
   const locale = application_data.locale;
 
+  OSM.i18n = I18n;
+
   I18n.default_locale = OSM.DEFAULT_LOCALE;
   I18n.locale = locale;
 
index a3d26ff7defce84a40650713035c6bdd72cda97a..899566d392764f049a5a07fd2308a44ca5a3abda 100644 (file)
@@ -6,6 +6,8 @@
 //= require i18n
 //= require i18n/embed
 
+const OSM = { i18n: I18n };
+
 if (navigator.languages) {
   I18n.locale = navigator.languages[0];
 } else if (navigator.language) {