diff options
author | Barry Warsaw <barry@python.org> | 2000-10-16 15:47:50 +0000 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2000-10-16 15:47:50 +0000 |
commit | a2fd05ab664ebe0f7bf6414755de105d410b3519 (patch) | |
tree | 60f0e8aff5425679fcf7545185984a110eaa07ba /Lib/gettext.py | |
parent | e6ea573bc04f6b426fff91c72443a09f62b70342 (diff) | |
download | cpython-a2fd05ab664ebe0f7bf6414755de105d410b3519.tar.gz |
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.
Diffstat (limited to 'Lib/gettext.py')
-rw-r--r-- | Lib/gettext.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/gettext.py b/Lib/gettext.py index 578490f68c..9bebb11ac4 100644 --- a/Lib/gettext.py +++ b/Lib/gettext.py @@ -208,13 +208,13 @@ def find(domain, localedir=None, languages=None): if 'C' not in languages: languages.append('C') # now normalize and expand the languages - langdict = {} + nelangs = [] for lang in languages: for nelang in _expand_lang(lang): - langdict[nelang] = nelang - languages = langdict.keys() + if nelang not in nelangs: + nelangs.append(nelang) # select a language - for lang in languages: + for lang in nelangs: if lang == 'C': break mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain) |