[openstreetmap/openstreetmap-website] Fallback processing for community name i18n (Issue #3814)

Andy Allan notifications at github.com
Wed Nov 23 10:56:53 UTC 2022


It looks like our fallback process for the community name i18n isn't sufficient. The osm-community-index has some extra complexity and indirection that nobody noticed during development.

Let's say we are viewing the site in Polish, and looking at the OpenStreetMap France chapter.

https://github.com/osmlab/osm-community-index/blob/main/resources/europe/france/fr-chapter.json
```json
  "id": "fr-chapter",
  "type": "osm-lc",
```

So we want to find out the name of the chapter, we look for `fr-chapter` in the pl.yaml file:

https://github.com/osmlab/osm-community-index/blob/main/i18n/pl.yaml

```yaml
  de-viersen-meetup:
    name: Spotkania OpenStreetMap Viersen
    description: Spotkania społeczności i użytkowników OSM z Viersen i Mönchengladbach
  fr-chapter:
    description: Pomagamy rozwijać i ulepszać OpenStreetMap we Francji.
  fr-matrix:
    description: 'Kanał społeczności OSM France na Matriksie: {url} (połączony z Telegramem)'
```

Note that there's a description, but there's **no name attribute**. It turns out that the name attributes are optional, as part of a process to reduce translation duplication. 

Since there's no name attribute, we can look up what the fallback should be for our object, which is an `osm-lc`:

```yaml
_defaults:
    ...
    osm:
      name: '{community}'
    osm-lc:
      name: '{community}'
    reddit:
      name: '{community} na Reddit'
      url: https://www.reddit.com/r/{account}
```

OK, so for local chapters, the name defaults to the community name. And in the `_communities` list, there's a bunch of community names, e.g. 

```yaml
_communities:
    geolibres: GeoLibres
    kiribatiwomeninmapping: Kobiety z Kiribati Mapujące
    mappingbotswana: Mapowanie Botswany
    ...
    openstreetmapfinland: OpenStreetMap Finlandia
    openstreetmapfrance: OpenStreetMap Francja
    openstreetmapfreemapslovakia: Strona Freemap Słowacja
```

So that's where we're supposed to get the name for the local chapter. 

But the missing piece of the puzzle for me is how do we find out the community to use (in this case `openstreetmapfrance`)? There's no link that I can find between `fr-chapter` and `openstreetmapfrance`, and in fact the `openstreetmapfrance` key is only found in the translations and not elsewhere in the osm-community-index repo.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3814
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/3814 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20221123/da6e8963/attachment.htm>


More information about the rails-dev mailing list