From: Andy Allan Date: Wed, 2 Mar 2022 16:24:02 +0000 (+0000) Subject: Move the i18n loading to an initializer X-Git-Tag: live~1594^2~18 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/e530d4f54dc7b2d0f37a5bae35efb81953995a2c Move the i18n loading to an initializer Use after_initialize to avoid rails resetting the translations --- diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index a73d1e2e5..524001d4d 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -107,7 +107,6 @@ class SiteController < ApplicationController end def communities - OsmCommunityIndex::LocalChapter.add_to_i18n # this should be called on app init @local_chapters = OsmCommunityIndex::LocalChapter.local_chapters end diff --git a/config/initializers/osm_community_index.rb b/config/initializers/osm_community_index.rb new file mode 100644 index 000000000..1400ef028 --- /dev/null +++ b/config/initializers/osm_community_index.rb @@ -0,0 +1,3 @@ +Rails.configuration.after_initialize do + OsmCommunityIndex::LocalChapter.add_to_i18n +end