changeset 3121:ca1c60a5285c

i18n.getText: renaming the 'formatted' (default True) keyword arg to 'wiki' (default False)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 26 Feb 2008 22:40:33 +0100
parents a7c1680aeaa0
children a1322262398a
files MoinMoin/i18n/__init__.py docs/CHANGES
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/i18n/__init__.py	Tue Feb 26 02:04:08 2008 +0100
+++ b/MoinMoin/i18n/__init__.py	Tue Feb 26 22:40:33 2008 +0100
@@ -239,8 +239,8 @@
     @param original: the original (english) text
     @param request: the request object
     @lang: the target language for the translation
-    @keyword formatted: True to use the wiki parser/formatter on the translation result,
-                        False to return the translation result "as is"
+    @keyword wiki: True to use the wiki parser/formatter on the translation result,
+                   False to return the translation result "as is"
     @keyword percent: True if we need special escaping because we use the translation
                       result as the left side of a % operator: e.g. % chars need to
                       become %% for that usage. This will only escape generated % chars,
@@ -249,8 +249,8 @@
                       Only specify this option for formatted==True, it doesn't do
                       anything for formatted==False.
     """
-    formatted = kw.get('formatted', True) # TODO: change to False, review all _() calls
-    percent = kw.get('percent', False) # TODO: review all _() calls
+    formatted = kw.get('wiki', False) # 1.6 and early 1.7 (until 2/2008) used 'formatted' with True as default!
+    percent = kw.get('percent', False)
     if original == u"":
         return u"" # we don't want to get *.po files metadata!
 
--- a/docs/CHANGES	Tue Feb 26 02:04:08 2008 +0100
+++ b/docs/CHANGES	Tue Feb 26 22:40:33 2008 +0100
@@ -60,6 +60,12 @@
   Developer notes (these should be moved to the end in the release):
     * changed formatter.attachment_link call (it is now more flexible,
       because you can render the stuff between link start and link end yourself)
+    * getText's (aka _()) 'formatted' keyword param (default: True in 1.6 and
+      early 1.7) was renamed/changed: it is now called 'wiki' and defaults to
+      False. Example calls:
+      _('This will NOT get parsed/formatted by MoinMoin!')
+      _('This will be parsed/formatted by MoinMoin!', wiki=True)
+      _('This will be used as a left side of percent operator. %s', percent=True)
 
   New Features:
     * new powerful and flexible logging, please see wiki/config/logging/.