From: Andy Allan Date: Wed, 30 Mar 2022 16:41:21 +0000 (+0100) Subject: Use String#tr instead of String.split(foo).join(bar) X-Git-Tag: live~1583^2~16 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/44286b46b1962c3bf1d1568faf0a7f38a2a634c2 Use String#tr instead of String.split(foo).join(bar) --- diff --git a/lib/osm_community_index/local_chapter.rb b/lib/osm_community_index/local_chapter.rb index 3b56f58e8..6df3c1bc9 100644 --- a/lib/osm_community_index/local_chapter.rb +++ b/lib/osm_community_index/local_chapter.rb @@ -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|