]> git.openstreetmap.org Git - rails.git/commitdiff
Skip path rebuilding
authorAdam Hoyle <atomoil@gmail.com>
Tue, 14 Dec 2021 10:17:02 +0000 (10:17 +0000)
committerAdam Hoyle <atomoil@gmail.com>
Tue, 14 Dec 2021 10:17:02 +0000 (10:17 +0000)
lib/osm_community_index/local_chapter.rb

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