miracle2k / android2po

Convert Android string resources to gettext, and back.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a2po does not support ISO 639-2 language codes

albertvaka opened this issue · comments

Since Android 5.0 [1] is now possible to use ISO 639-2 language codes [2] like «ast» for localization files (values-xxx). While trying to import an "ast.po" file using a2po import, I get the following error:

    [failed] ast is not a valid locale

Can you add support for these three-letter language codes?

[1] https://code.google.com/p/android/issues/detail?id=63358
[2] http://www.loc.gov/standards/iso639-2/php/code_list.php

I won't have time to add this any time soon, but would of course accept a pull request.

It seems to be a limitation in Babel. I opened an issue with them [1], but if it can't be easily fixed there I will submit a PR here to ignore these kind of errors. Would that be okay?

[1] python-babel/babel#285

If a workaround is possible, sure. I don't know if it is important that we have a Babel instance.

It looks like it's not a but. Installing a newer version of Babel fixed the issue.

Sorry and thank you!

Finally, it looks like the current version of android2po in the pip repo (1.2) depends on an older version of Babel where this is still an issue. Can you make a release of the current git master, so a version without this problem is available through pip?

@miracle2k Any updates? It would be awesome if you could make a new release :) There have been many changes and fixes since the last version, including the fix for this bug. Thanks a lot for your time!

I pushed a new version.