[openstreetmap/openstreetmap-website] Show diary languages in users language (#2298)
Andy Allan
notifications at github.com
Wed Jul 3 10:43:09 UTC 2019
We store the language code for diary entries. However, [we only show the language as "English name (Native Name)"](https://github.com/openstreetmap/openstreetmap-website/blob/f9109b7a75f91c208a7b5f68cc64ba253a9041c5/app/models/language.rb#L29-L33). This leaves no possibility to translate it to the users own language. For example, a French user will see "German (Deutch)". We all get to see "English (English)" too :smile:
We could change this to use our translations system, so that the language is looked up like normal rails strings. However, we have 197 diary languages, and so that's a lot of work for our translators when there are other sources of language names available. It is, however, the simplest option.
Other sources of language information are available. I've made some initial research and it appears there are two widely-used original sources:
* CLDR - http://cldr.unicode.org/
* Debian iso-codes - https://salsa.debian.org/iso-codes-team/iso-codes
Using these directly would be a pain, but there are various gems available. For example:
* [i18n_data](https://github.com/grosser/i18n_data) uses iso-codes
* [twitter-cldr](https://github.com/twitter/twitter-cldr-rb) uses CLDR
There are other gems available, and perhaps other sources of language translations too. We should figure out what works best for us.
--
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/issues/2298
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190703/03e28ea7/attachment.html>
More information about the rails-dev
mailing list