[openstreetmap/openstreetmap-website] Add Communities page (#3301)
Andy Allan
notifications at github.com
Wed Aug 10 16:23:10 UTC 2022
@gravitystorm commented on this pull request.
> + files.each do |file|
+ locale = File.basename(file, ".yaml")
+ community_locale_yaml = YAML.safe_load(File.read(file))[locale]
+ # rails wants en-GB but osm-community-index has en_GB
+ locale_rails = locale.tr("_", "-")
+ data = {}
+
+ communities.each do |community|
+ id = community[:id]
+
+ strings = community_locale_yaml[id] || {}
+ # if the name isn't defined then fall back on community,
+ # as per discussion here: https://github.com/osmlab/osm-community-index/issues/483
+ strings["name"] = strings["name"] || community["strings"]["name"] || community["strings"]["community"]
+
+ data.deep_merge!({ "osm_community_index" => { "communities" => { id => strings } } })
Removed
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3301#discussion_r942659828
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/3301/review/1068585823 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220810/9da2abba/attachment.htm>
More information about the rails-dev
mailing list