projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf1f882
)
Filter out the communities before loading the translations
author
Andy Allan
<git@gravitystorm.co.uk>
Wed, 10 Aug 2022 16:34:24 +0000
(17:34 +0100)
committer
Andy 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
patch
|
blob
|
history
diff --git
a/lib/osm_community_index.rb
b/lib/osm_community_index.rb
index eb7948514369eff689f3d90bd2bc3f2a7fa863b7..fb3d7b28ed656be537ec44303d0fda3b566ad234 100644
(file)
--- 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")