changeset 2464:3c5b329afe4b

Add a pseudo-getText function to that strings can get into .po files
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Fri, 20 Jul 2007 01:46:31 +0200
parents 920089399dfa
children 474b7a1fc031 474448e88c24
files MoinMoin/events/__init__.py
diffstat 1 files changed, 14 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/events/__init__.py	Fri Jul 20 00:32:07 2007 +0200
+++ b/MoinMoin/events/__init__.py	Fri Jul 20 01:46:31 2007 +0200
@@ -23,6 +23,9 @@
 logger.setLevel(logging.DEBUG)
 logger.addHandler(logging.StreamHandler())
 
+# Dummy pseudo-getText function used in event descriptions,
+# so that they get into .po files
+_ = lambda x: x
 
 class Event(object):
     """A class handling information common to all events."""
@@ -38,7 +41,7 @@
 
 class PageChangedEvent(PageEvent):
 
-    description = u"""Page has been modified (edit, creation, deletion)"""
+    description = _(u"""Page has been modified (edit, creation, deletion)""")
     req_superuser = False
 
     def __init__(self, request, page, comment, trivial):
@@ -50,7 +53,7 @@
 
 class PageRenamedEvent(PageEvent):
 
-    description = u"""Page has been renamed"""
+    description = _(u"""Page has been renamed""")
     req_superuser = False
 
     def __init__(self, request, page, old_page, comment=""):
@@ -62,7 +65,7 @@
 
 class PageDeletedEvent(PageEvent):
 
-    description = u"""Page has been deleted"""
+    description = _(u"""Page has been deleted""")
     req_superuser = False
 
     def __init__(self, request, page, comment):
@@ -73,7 +76,7 @@
 
 class PageCopiedEvent(PageEvent):
 
-    description = u"""Page has been copied"""
+    description = _(u"""Page has been copied""")
     req_superuser = False
 
     def __init__(self, request, page, old_page, comment):
@@ -85,7 +88,7 @@
 
 class FileAttachedEvent(PageEvent):
 
-    description = u"""A new attachment has been added"""
+    description = _(u"""A new attachment has been added""")
     req_superuser = False
 
     def __init__(self, request, pagename, name, size):
@@ -98,7 +101,7 @@
 
 class PageRevertedEvent(PageEvent):
 
-    description = u"""A page has been reverted to a previous state"""
+    description = _(u"""A page has been reverted to a previous state""")
     req_superuser = False
 
     def __init__(self, request, pagename, previous, current):
@@ -110,7 +113,7 @@
 
 class SubscribedToPageEvent(PageEvent):
 
-    description = u"""An user has subscribed to a page"""
+    description = _(u"""An user has subscribed to a page""")
     req_superuser = True
 
     def __init__(self, request, pagename, username):
@@ -140,7 +143,7 @@
 class UserCreatedEvent(Event):
     """ Sent when a new user has been created """
 
-    description = u"""A new account has been created"""
+    description = _(u"""A new account has been created""")
     req_superuser = True
 
     def __init__(self, request, user):
@@ -233,3 +236,6 @@
             subscribable_events[ev.__name__] = {'desc': ev.description,
                                                  'superuser': ev.req_superuser}
     return subscribable_events
+
+# Get rid of the dummy getText so that it doesn't get imported with *
+del _