Skip to content
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

"ValueError: expected only letters, got u'ko-kr'" #489

Closed
ajaeger opened this issue Apr 6, 2017 · 5 comments
Closed

"ValueError: expected only letters, got u'ko-kr'" #489

ajaeger opened this issue Apr 6, 2017 · 5 comments

Comments

@ajaeger
Copy link

ajaeger commented Apr 6, 2017

With Babel 2.4.0 we get:
File "/home/jenkins/workspace/openstack-manuals-tox-doc-publishlang/.tox/venv/local/lib/python2.7/site-packages/babel/core.py", line 1093, in parse_locale
"ValueError: expected only letters, got u'ko-kr'"

This comes from using "ko-kr" as locale in http://git.openstack.org/cgit/openstack/openstack-manuals/tree/doc/install-guide/source/locale/ko_KR/LC_MESSAGES/install-guide.po#n42

We didn't have this problem with earlier Babel releases.

Other places in Babel accept the '-' like https://github.com/python-babel/babel/blob/v2.4.0/tests/test_core.py#L100 - why not here as well and break existing files this way?

@akx
Copy link
Member

akx commented Apr 6, 2017

Hi!

The default separator for parse_locale() is the underscore, so in your case the locale name should be ko_KR.

The location you linked, https://github.com/python-babel/babel/blob/v2.4.0/tests/test_core.py#L100, explicitly passes sep='-', which is why it works.

The behavior of parse_locale() has not changed between 2.3.4 and 2.4.0; the last changes to that code are from 2008. :)

@ajaeger
Copy link
Author

ajaeger commented Apr 6, 2017

@akx, while parse_locale() has not changed, 08b9c5e now parses the po file which did not happen before - and thus introduces the problem.

@akx
Copy link
Member

akx commented Apr 6, 2017

Ahhh, right you are! Didn't think about that.

@akx
Copy link
Member

akx commented Apr 6, 2017

I'll wait for a while before cutting 2.4.1, in case there are other bug reports.

@ajaeger
Copy link
Author

ajaeger commented Apr 6, 2017

Thanks a lot @akx !

openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Apr 7, 2017
Project: openstack/requirements  2c3104a70cbfeb1f754ce8e123bb5985e5d1bda9

Blacklist Babel 2.4.0

Babel 2.4.0 does not handle "-" in locale po files
like "ko-KR". This is fixed now for the upcoming Babel 2.4.1 release.

To be able to publish translated content, blacklist Babel 2.4.0.

For details, see
python-babel/babel#489

Change-Id: I3bd63b3c4798270890c7cabe1d4e7aedf1aaa1ed
openstack-gerrit pushed a commit to openstack/requirements that referenced this issue Apr 7, 2017
Babel 2.4.0 does not handle "-" in locale po files
like "ko-KR". This is fixed now for the upcoming Babel 2.4.1 release.

To be able to publish translated content, blacklist Babel 2.4.0.

For details, see
python-babel/babel#489

Change-Id: I3bd63b3c4798270890c7cabe1d4e7aedf1aaa1ed
openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Apr 7, 2017
Project: openstack/requirements  2c3104a70cbfeb1f754ce8e123bb5985e5d1bda9

Blacklist Babel 2.4.0

Babel 2.4.0 does not handle "-" in locale po files
like "ko-KR". This is fixed now for the upcoming Babel 2.4.1 release.

To be able to publish translated content, blacklist Babel 2.4.0.

For details, see
python-babel/babel#489

Change-Id: I3bd63b3c4798270890c7cabe1d4e7aedf1aaa1ed
tanaypf9 pushed a commit to tanaypf9/pf9-requirements that referenced this issue May 20, 2024
Babel 2.4.0 does not handle "-" in locale po files
like "ko-KR". This is fixed now for the upcoming Babel 2.4.1 release.

To be able to publish translated content, blacklist Babel 2.4.0.

For details, see
python-babel/babel#489

Change-Id: I3bd63b3c4798270890c7cabe1d4e7aedf1aaa1ed
(cherry picked from commit a6f7497)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants