Filter out the communities before loading the translations
This avoids loading excessive numbers of translations
This commit is contained in:
parent
bf1f882eb8
commit
7e62e2b5ed
1 changed files with 3 additions and 1 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue