Skip to content

android resource files with hyphens in filename #48

@farindk

Description

@farindk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions