]> git.openstreetmap.org Git - rails.git/commitdiff
Use String#tr instead of String.split(foo).join(bar)
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 30 Mar 2022 16:41:21 +0000 (17:41 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 30 Mar 2022 16:41:30 +0000 (17:41 +0100)
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|