tuskyapp / Tusky

An Android client for the microblogging server Mastodon
https://tusky.app
GNU General Public License v3.0
2.46k stars 389 forks source link

Put the Berber language resources in the correct place #3637

Open nikclayton opened 1 year ago

nikclayton commented 1 year ago

I think the Berber language resources might be in the wrong directory, and the correct place is probably values-b+tzm+Tfng. I'm filing this issue so that hopefully someone with more knowledge about this stuff than I have can post any corrections.

Here's what I know so far.

The Berber specific resources are in a directory called values-ber.

This is a problem for three reasons.

First, according to the Android docs, this part of the resource qualifier should be:

The language is defined by a two-letter ISO 639-1 language code, optionally followed by a two-letter ISO 3166-1-alpha-2 region code (preceded by lowercase r). [...] Android 7.0 (API level 24) introduced support for BCP 47 language tags, which you can use to qualify language- and region-specific resources. A language tag is composed from a sequence of one or more subtags, each of which refines or narrows the range of language identified by the overall tag. For more information about language tags, see Tags for Identifying Languages.

To use a BCP 47 language tag, concatenate b+ and a two-letter ISO 639-1 language code, optionally followed by additional subtags separated by +. source: https://developer.android.com/guide/topics/resources/providing-resources#table2

Key takeaway there is that the code is only supposed to be two characters, not three. Note also that the docs say it's an ISO 639-1 code, but links to the ISO 639-2 codes, so Android may support the 639-2 codes. I've opened https://issuetracker.google.com/issues/281669779 to verify that.

Second, assuming that a three letter code is allowed, I'm not sure that ber is the correct one to use.

If Android supports ISO 639-2, but not ISO 639-3 then ber is correct.

However, if Android supports ISO 639-3 then there are three possible language codes that can be used (according to http://lrwiki.ldc.upenn.edu/mediawiki/index.php/Berber/Berber).

I think the current translation is in Tamazight, so tzm is the correct ISO 639-3 language code.

Third, the languages can be written in different scripts, Tifinagh, Arabic, and Latin.

The current translation is in the Tifinagh script. According to https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry the script subtag for that is Tfng.

Summary

values-ber is probably wrong.

If Android doesn't properly support ISO 639-2 or ISO 639-3 codes we may have a problem, as this shouldn't work. In practice it appears to at the moment, but that might just be luck.

If Android does support ISO 639-2 codes the correct directory is values-b+ber+Tfng.

If Android does support ISO 639-3 codes the correct directory is values-b+tzm+Tfng.

I think. I'm going to point some speakers / translators of the language at this to solicit feedback.


nikclayton commented 1 year ago

If I build after renaming values-ber to values-b+tzm+Tfng language selection still appears to work, and Tusky is localised as expected.

So if tzm and Tfng are the correct codes to use then that's the correct name.