Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 75f8101

Browse files
committed
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.
1 parent 21000ca commit 75f8101

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/gettext.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,13 @@ def find(domain, localedir=None, languages=None):
208208
if 'C' not in languages:
209209
languages.append('C')
210210
# now normalize and expand the languages
211-
langdict = {}
211+
nelangs = []
212212
for lang in languages:
213213
for nelang in _expand_lang(lang):
214-
langdict[nelang] = nelang
215-
languages = langdict.keys()
214+
if nelang not in nelangs:
215+
nelangs.append(nelang)
216216
# select a language
217-
for lang in languages:
217+
for lang in nelangs:
218218
if lang == 'C':
219219
break
220220
mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain)

0 commit comments

Comments
 (0)