]> git.openstreetmap.org Git - rails.git/commitdiff
Filter out the communities before loading the translations
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 10 Aug 2022 16:34:24 +0000 (17:34 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 10 Aug 2022 16:34:24 +0000 (17:34 +0100)
This avoids loading excessive numbers of translations

lib/osm_community_index.rb

index eb7948514369eff689f3d90bd2bc3f2a7fa863b7..fb3d7b28ed656be537ec44303d0fda3b566ad234 100644 (file)
@@ -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")