<p>We store the language code for diary entries. However, <a href="https://github.com/openstreetmap/openstreetmap-website/blob/f9109b7a75f91c208a7b5f68cc64ba253a9041c5/app/models/language.rb#L29-L33">we only show the language as "English name (Native Name)"</a>. 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 <g-emoji class="g-emoji" alias="smile" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f604.png">😄</g-emoji></p>
<p>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.</p>
<p>Other sources of language information are available. I've made some initial research and it appears there are two widely-used original sources:</p>
<ul>
<li>CLDR - <a href="http://cldr.unicode.org/" rel="nofollow">http://cldr.unicode.org/</a></li>
<li>Debian iso-codes - <a href="https://salsa.debian.org/iso-codes-team/iso-codes" rel="nofollow">https://salsa.debian.org/iso-codes-team/iso-codes</a></li>
</ul>
<p>Using these directly would be a pain, but there are various gems available. For example:</p>
<ul>
<li><a href="https://github.com/grosser/i18n_data">i18n_data</a> uses iso-codes</li>
<li><a href="https://github.com/twitter/twitter-cldr-rb">twitter-cldr</a> uses CLDR</li>
</ul>
<p>There are other gems available, and perhaps other sources of language translations too. We should figure out what works best for us.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/2298?email_source=notifications&email_token=AAK2OLOROH7FYYRFEXW7GH3P5R7D3A5CNFSM4H5EOGA2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G5DGAAA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJV6I2QY2EW7BXRACLP5R7D3ANCNFSM4H5EOGAQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAK2OLKT3CHFVPHHHLKZNLDP5R7D3A5CNFSM4H5EOGA2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G5DGAAA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/2298?email_source=notifications\u0026email_token=AAK2OLOROH7FYYRFEXW7GH3P5R7D3A5CNFSM4H5EOGA2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G5DGAAA",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/2298?email_source=notifications\u0026email_token=AAK2OLOROH7FYYRFEXW7GH3P5R7D3A5CNFSM4H5EOGA2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G5DGAAA",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>