From: Adam Hoyle Date: Tue, 14 Dec 2021 10:17:02 +0000 (+0000) Subject: Skip path rebuilding X-Git-Tag: live~1763^2~26 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/6b8c58d2eb7d26d2cae23c1f30390f0321d558a2?ds=sidebyside Skip path rebuilding --- diff --git a/lib/osm_community_index/local_chapter.rb b/lib/osm_community_index/local_chapter.rb index ca63d3782..c92561487 100644 --- a/lib/osm_community_index/local_chapter.rb +++ b/lib/osm_community_index/local_chapter.rb @@ -28,11 +28,10 @@ module OsmCommunityIndex def self.add_to_i18n community_index = OsmCommunityIndex.community_index - files = Dir.children(Rails.root.join("node_modules/osm-community-index/i18n/")) + files = Dir.children(Rails.root.join("node_modules/osm-community-index/i18n/*")) files.each do |file| - path = Rails.root.join("node_modules/osm-community-index/i18n/#{file}") locale = File.basename(file,".yaml") - community_index_yaml = YAML.safe_load(File.read(path))[locale] + community_index_yaml = YAML.safe_load(File.read(file))[locale] # rails wants en-GB but osm-community-index has en_GB locale_rails = locale.split("_").join("-")