[openstreetmap/openstreetmap-website] Add Communities page (#3301)

Andy Allan notifications at github.com
Wed Nov 24 16:39:02 UTC 2021


> I also had a brief look at ways of loading data into the i18n system, but again I don't have anything to share yet.

I think the answer to this bit is `I18n.backend.store_translations`, which is [described in the i18n documentation](https://guides.rubyonrails.org/i18n.html). For example:

```
I18n.backend.store_translations :en, inbox: {
  zero: 'no messages', # optional
  one: 'one message',
  other: '%{count} messages'
} 
```

> It would be a simple script that runs once every half year (or whenever there's a new local chapter), and updates some yml file we'd consume during runtime.

I'm not super-keen on this approach, even for the existing wiki_pages.yml file. It reminds me of the old "vendoring" approach to code dependencies, where we ended up with copies of source code in our repo even though we weren't maintaining it. The current wiki_pages approach does the same, but for data. As a rule of thumb, I don't like having files in the repo where [the commit history just consists of "copy information from external source"](https://github.com/openstreetmap/openstreetmap-website/commits/master/config/wiki_pages.yml) over and over again.

So I'd rather have a gem-like (or yarn-like) approach, where third-party (code / data / yml / javascripts / CSS / whatever) is maintained elsewhere rather than in-repo, and we pull in copies through our dependency managers.  Since the communities data is coming from a node module, I think using yarn to manage this dependency is the right approach.

My concern is then just to ensure that the community data gets loaded during application boot, and not at request time.

-- 
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#issuecomment-978044184
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20211124/7cf2b88a/attachment.htm>


More information about the rails-dev mailing list