From e530d4f54dc7b2d0f37a5bae35efb81953995a2c Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 2 Mar 2022 16:24:02 +0000 Subject: [PATCH 1/1] Move the i18n loading to an initializer Use after_initialize to avoid rails resetting the translations --- app/controllers/site_controller.rb | 1 - config/initializers/osm_community_index.rb | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 config/initializers/osm_community_index.rb 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 -- 2.39.5