]> git.openstreetmap.org Git - rails.git/blobdiff - lib/osm_community_index/local_chapter.rb
Use String#tr instead of String.split(foo).join(bar)
[rails.git] / lib / osm_community_index / local_chapter.rb
index 3b56f58e811a50e9288cbb55c5dce02d33b5e384..6df3c1bc9edcd37340c33c994c6c3bf2b9bc969e 100644 (file)
@@ -42,7 +42,7 @@ module OsmCommunityIndex
         locale = File.basename(file, ".yaml")
         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("-")
+        locale_rails = locale.tr("_", "-")
         data = {}
 
         raw_local_chapters.each do |chapter|