From: Andy Allan Date: Wed, 10 Aug 2022 16:34:24 +0000 (+0100) Subject: Filter out the communities before loading the translations X-Git-Tag: live~1763^2~5 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/7e62e2b5edb8100ff4b29cf34abfb8a9316c9996 Filter out the communities before loading the translations This avoids loading excessive numbers of translations --- 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")