mirror of https://github.com/python/cpython.git
find(): Application of (slightly modified) SF patch #101928 by Ulf
Betlehem, verified by Peter Funk. Fixes preservation of language search order lost due to use of dictionary keys instead of a list. Closes SF bug #116964.
This commit is contained in:
parent
21000caee7
commit
75f8101c42
|
@ -208,13 +208,13 @@ def find(domain, localedir=None, languages=None):
|
||||||
if 'C' not in languages:
|
if 'C' not in languages:
|
||||||
languages.append('C')
|
languages.append('C')
|
||||||
# now normalize and expand the languages
|
# now normalize and expand the languages
|
||||||
langdict = {}
|
nelangs = []
|
||||||
for lang in languages:
|
for lang in languages:
|
||||||
for nelang in _expand_lang(lang):
|
for nelang in _expand_lang(lang):
|
||||||
langdict[nelang] = nelang
|
if nelang not in nelangs:
|
||||||
languages = langdict.keys()
|
nelangs.append(nelang)
|
||||||
# select a language
|
# select a language
|
||||||
for lang in languages:
|
for lang in nelangs:
|
||||||
if lang == 'C':
|
if lang == 'C':
|
||||||
break
|
break
|
||||||
mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain)
|
mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain)
|
||||||
|
|
Loading…
Reference in New Issue