homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mfabian
Recipients mfabian
Date 2013年11月09日.08:05:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1383984326.4.0.578976850668.issue19534@psf.upfronthosting.co.za>
In-reply-to
Content
The problem turns out to be caused by a problem in normalizing
the locale name, see the output of this test program:
mfabian@ari:~
$ cat ~/tmp/mike-test.py
#!/usr/bin/python2
import sys
import os
import locale
import encodings
import encodings.aliases
test_locales = [
 'ja_JP.UTF-8',
 'de_DE.SJIS',
 'de_DE.foobar',
 'sr_RS.UTF-8@latin',
 'sr_rs@latin',
 'sr@latin',
 'sr_yu',
 'sr_yu.SJIS@devanagari',
 'sr@foobar',
 'sR@foObar',
 'sR',
]
for test_locale in test_locales:
 print("%(orig)s -> %(norm)s"
 %{'orig': test_locale,
 'norm': locale.normalize(test_locale)}
 )
mfabian@ari:~
$ python2 ~/tmp/mike-test.py
ja_JP.UTF-8 -> ja_JP.UTF-8
de_DE.SJIS -> de_DE.SJIS
de_DE.foobar -> de_DE.foobar
sr_RS.UTF-8@latin -> sr_RS.utf_8_latin
sr_rs@latin -> sr_RS.UTF-8@latin
sr@latin -> sr_RS.UTF-8@latin
sr_yu -> sr_RS.UTF-8@latin
sr_yu.SJIS@devanagari -> sr_RS.sjis_devanagari
sr@foobar -> sr@foobar
sR@foObar -> sR@foObar
sR -> sr_RS.UTF-8
mfabian@ari:~
$ 
I.e. "sr_RS.UTF-8@latin" is normalized to "sr_RS.utf_8_latin" which
is clearly wrong and causes a fallback to sr_RS when using gettext
which gives the cyrillic translations.
History
Date User Action Args
2013年11月09日 08:05:26mfabiansetrecipients: + mfabian
2013年11月09日 08:05:26mfabiansetmessageid: <1383984326.4.0.578976850668.issue19534@psf.upfronthosting.co.za>
2013年11月09日 08:05:26mfabianlinkissue19534 messages
2013年11月09日 08:05:26mfabiancreate

AltStyle によって変換されたページ (->オリジナル) /