From: Anton Khorev Date: Sun, 9 Mar 2025 15:09:41 +0000 (+0300) Subject: Merge branch 'pull/5745' X-Git-Tag: live~179 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/a0768a4d04d3eb5afa9e8864b8fc73a64286bf2c?hp=dd57602d7e97a8141cee0476a5a48e31917d07b6 Merge branch 'pull/5745' --- diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index c8f188a2e..4991e82fb 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -21,7 +21,6 @@ I18n.default_locale = OSM.DEFAULT_LOCALE; I18n.locale = locale; - I18n.fallbacks = true; // '-' 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]]; diff --git a/config/initializers/i18n.rb b/config/initializers/i18n.rb index 8f74c3cd3..a316db408 100644 --- a/config/initializers/i18n.rb +++ b/config/initializers/i18n.rb @@ -21,25 +21,14 @@ module OpenStreetMap super end end - - module ValidateLocales - def default_fallbacks - super.select do |locale| - ::I18n.available_locales.include?(locale) - end - end - end end end I18n::Backend::Simple.prepend(OpenStreetMap::I18n::NormaliseLocales) -I18n::JS::FallbackLocales.prepend(OpenStreetMap::I18n::ValidateLocales) I18n::Backend::Simple.include(I18n::Backend::PluralizationFallback) I18n::Backend::Simple.include(I18n::Backend::Fallbacks) -I18n.fallbacks.map("no" => "nb") - I18n.enforce_available_locales = false if Rails.env.test?