[openstreetmap/openstreetmap-website] Add Communities page (#3301)
Andy Allan
notifications at github.com
Thu Nov 25 11:51:54 UTC 2021
@gravitystorm commented on this pull request.
> + local_chapters = []
+ community_index["resources"].each do |id, resource|
+ resource.each do |key, value|
+ next unless key == "type" && value == "osm-lc" && id != "OSMF"
+
+ # name comes via I18n
+ url = resource["strings"]["url"]
+ local_chapters.push(LocalChapter.new(id, url))
+ end
+ end
+ local_chapters
+ end
+
+ def self.add_to_i18n
+ community_index = OsmCommunityIndex.community_index
+ files = Dir.children(Rails.root.join("node_modules/osm-community-index/i18n/"))
`Dir.glob(Rails.root.join("node....i18n/*")` (note the *) will return an array of file paths, so then you can skip the path rebuilding bit two lines further down.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3301#pullrequestreview-815895500
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20211125/50f9796c/attachment.htm>
More information about the rails-dev
mailing list