changeset 5376:af9872c96dcb

i18n: fix in-memory caching of formatted msgs Fixes http://moinmo.in/MoinMoinBugs/1.9EditPageHelpLinksBroken by including the wiki's (different) siteids into the caching dict key.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 13 Dec 2009 23:44:51 +0100
parents 97a4b92d2055
children 62984251a3cd
files MoinMoin/i18n/__init__.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/i18n/__init__.py	Sun Dec 13 21:03:59 2009 +0100
+++ b/MoinMoin/i18n/__init__.py	Sun Dec 13 23:44:51 2009 +0100
@@ -289,7 +289,10 @@
     if original in translation.raw:
         translated = translation.raw[original]
         if formatted:
-            key = (original, percent)
+            # it is important to include siteid and percent into the key because
+            # formatted output depends on the (farm) wiki in which the page is
+            # rendered (e.g. for link urls) and also on the percent param
+            key = (original, request.cfg.siteid, percent)
             if key in translation.formatted:
                 translated = translation.formatted[key]
                 if translated is None: