From 7e62e2b5edb8100ff4b29cf34abfb8a9316c9996 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 10 Aug 2022 17:34:24 +0100 Subject: [PATCH] Filter out the communities before loading the translations This avoids loading excessive numbers of translations --- lib/osm_community_index.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/osm_community_index.rb b/lib/osm_community_index.rb index eb7948514..fb3d7b28e 100644 --- a/lib/osm_community_index.rb +++ b/lib/osm_community_index.rb @@ -1,6 +1,8 @@ module OsmCommunityIndex def self.add_to_i18n - communities = Community.all + # Filter the communities here to avoid loading excessive numbers of translations + communities = Community.where(:type => "osm-lc").where.not(:id => "OSMF") + files = Dir.glob(Rails.root.join("node_modules/osm-community-index/i18n/*.yaml")) files.each do |file| locale = File.basename(file, ".yaml") -- 2.39.5