android2po icon indicating copy to clipboard operation
android2po copied to clipboard

android resource files with hyphens in filename

Open farindk opened this issue 9 years ago • 0 comments

I have a couple of Android resource files named like this: "strings-dialogs.xml". When processing them with "a2po export", I get crashes saying: ... File "/home/farindk/.local/ File "/home/farindk/.local/lib/python2.7/site-packages/babel/core.py", line 902, in parse_locale raise ValueError('expected only letters, got %r' % lang) ValueError: expected only letters, got u'dialogs-de'

I did not look deeper into this, but my guess what goes wrong is this: in order to get the language code, the script searches for the first hyphen and considers the rest of the name the language code. This fails in this case, because of the two hyphens in the name.

Probably the simple fix would be to search for the last hypen in the name instead of the first one.

farindk avatar May 20 '16 22:05 farindk