-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Automatically update the list of supported locales #803
[RFC] Automatically update the list of supported locales #803
Conversation
@@ -0,0 +1,10 @@ | |||
{ | |||
"cs": "cz", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actaually need this mapping? The langtable provides the most common territory for a language if we do not know it from the PO file name. See https://raw.githubusercontent.com/mike-fabian/langtable/main/langtable/data/languages.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you are right, the territories are sorted by rank. I will fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for the record: it turned out that e.g. for "pt" the highest ranked is "pt_BR" which is actually correct from the ranking POV, but usually the "pt_PT" is the default...
* It updates the list of supported locales.
Added languages currently supported by YaST (yast2-trans-* packages), we can expect that Agama will support a similar set.
Problem
#796 uses the list of locales included in the manifest.js file. Maintaining that list by hand is not an option, so we need a mechanism to do it automatically.
Solution
Add a update-manifest.py script that runs every time the PO files are imported from the agama-weblate repository.
xx.po
orxx_yy.po
(wherexx
is the language andyy
the territory). In the case ofxx.po
files, you cannot infer the territory from the name. For example,es.po
corresponds toes_es.po
, butuk.po
corresponds touk_ua
. That's why we have a map.manifest.json
file, including the locale code (en-us) and the name of the language (English). If there is more than one locale for the same language, it includes the territory in the name (e.g., English (United Kingdom) and English (Great Britain). Otherwise, it just uses the language name (English).Testing
To do