changeset 5171:1f922d6aaba6

i18n: check if languages is not initialized yet, don't crash
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 20 Sep 2009 20:30:23 +0200
parents df7d3de0e8cb
children f8d1d1d5c7a5
files MoinMoin/i18n/__init__.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/i18n/__init__.py	Sun Sep 20 15:41:13 2009 +0200
+++ b/MoinMoin/i18n/__init__.py	Sun Sep 20 20:30:23 2009 +0200
@@ -282,6 +282,9 @@
                 translation.formatted[key] = translated # remember it
     else:
         try:
+            if languages is None:
+                # languages not initialized yet
+                raise KeyError
             language = languages[lang]['x-language-in-english']
             dictpagename = "%sDict" % language.replace(' ', '')
             dicts = request.dicts