[openstreetmap/openstreetmap-website] Remove outdated pt translation (Issue #3670)
Andy Allan
notifications at github.com
Wed Aug 31 16:05:32 UTC 2022
As found while working on #3653 we have a stray translation file `pt.yml` that [hasn't been updated in around 8 years](https://github.com/openstreetmap/openstreetmap-website/blob/04ff7d4ee81040f152c38ee39ba84491c91a66f3/config/locales/pt.yml).
My first thought is to simply remove it immediately, since it's woefully outdated, and we have `pt-PT` and `pt-BR` translations that are kept up to date. But my concern is that without this file, any browser requesting "pt" will see the default English translation, since our Locale detection doesn't "fall-forwards" i.e. it doesn't choose a more specific locale if the more general locale is missing.
After removing the `pt.yml` file:
```ruby
Locale.available.preferred(Locale.list("pt"))
=> #<struct Locale language="en", script=nil, region=nil, variant=nil, extension=nil, privateuse=nil, grandfathered=nil>
Locale.available.preferred(Locale.list("pt-PT"))
=> #<struct Locale language="pt", script=nil, region="PT", variant=nil, extension=nil, privateuse=nil, grandfathered=nil>
```
Would this limitation be acceptable? Does anyone know how common it is for browsers to request "pt" translations, as opposed to "pt-PT" or "pt-BR"?
An alternative would be to change one of the two `pt-*` translations to use the `pt` key, and then the regular fallbacks would cover all situations. It's worth noting here that:
* [Translatewiki](https://translatewiki.net/wiki/Translating:OpenStreetMap) has `pt` and `pt-br`
* [transifex for iD](https://www.transifex.com/openstreetmap/id-editor/languages/) has `pt` and `pt_BR`
* [rails-i18n](https://github.com/svenfuchs/rails-i18n/tree/master/rails/locale) also has `pt` and `pt-BR`.
So perhaps a better solution is to change the translatewiki export to:
1. stop the translatewiki export from remapping `pt` to `pt-PT`,
2. allow it to overwrite our old `pt.yml`,
3. and then finally remove the `pt-PT.yml` file instead.
Any thoughts?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3670
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/3670 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220831/7cf01d1e/attachment.htm>
More information about the rails-dev
mailing list