summaryrefslogtreecommitdiffstats
path: root/Lib/gettext.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2000-10-16 15:47:50 (GMT)
committerBarry Warsaw <barry@python.org>2000-10-16 15:47:50 (GMT)
commit75f8101c429e132472bba92f3972b7eac68f35f8 (patch)
tree48c76c52ed8dd5bba4e235fd26c9fc0628863bff /Lib/gettext.py
parent21000caee72914d0108c58918edb1817d67e4025 (diff)
downloadcpython-75f8101c429e132472bba92f3972b7eac68f35f8.zip
cpython-75f8101c429e132472bba92f3972b7eac68f35f8.tar.gz
cpython-75f8101c429e132472bba92f3972b7eac68f35f8.tar.bz2
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.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/gettext.py b/Lib/gettext.py
index 578490f..9bebb11 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)