changeset 1629:2efb597c14d1

i18n via *Dict pages: we have them in request.dicts, no need to check for .exists()
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 21 Oct 2006 02:16:16 +0200
parents 79679aa664a3
children 9a8fdd5a03d3
files MoinMoin/Page.py MoinMoin/i18n/__init__.py
diffstat 2 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Sat Oct 21 01:50:39 2006 +0200
+++ b/MoinMoin/Page.py	Sat Oct 21 02:16:16 2006 +0200
@@ -60,6 +60,7 @@
             name,
             key,
         ))
+        #if name == u"GermanDict": raise "DeBugging"
         return data
 
     def refresh(self, request):
--- a/MoinMoin/i18n/__init__.py	Sat Oct 21 01:50:39 2006 +0200
+++ b/MoinMoin/i18n/__init__.py	Sat Oct 21 02:16:16 2006 +0200
@@ -234,16 +234,12 @@
         translated = trans_table[original]
     except KeyError:
         try:
-            from MoinMoin.Page import Page
             language = languages[lang]['x-language-in-english']
             dictpagename = "%sDict" % language
-            if Page(request, dictpagename).exists():
-                dicts = request.dicts
-                if dicts.has_dict(dictpagename):
-                    userdict = dicts.dict(dictpagename)
-                    translated = userdict[original]
-                else:
-                    raise KeyError
+            dicts = request.dicts
+            if dicts.has_dict(dictpagename):
+                userdict = dicts.dict(dictpagename)
+                translated = userdict[original]
             else:
                 raise KeyError
         except KeyError: