Anonymous committed 521caa8

i18n: Added a few missing translation markers.

Comments (0)

Files changed (6)


         <form class="addnew" id="addenum" method="post" action="">
-            <legend>Add $label_singular</legend>
+            <legend i18n:msg="label_singular">Add $label_singular</legend>
             <div class="field">
               <label>Name:<input type="text" name="name" id="name"/></label>


 <html xmlns=""
-      xmlns:py="">
+      xmlns:py=""
+      xmlns:i18n="">
   <xi:include href="admin.html" />
         <legend>Install Plugin:</legend>
         <div class="field">
-          <label>
+          <label i18n:msg="">
             File: <input type="file" name="plugin_file" disabled="${readonly or None}" />
 from trac.core import *
 from trac.util import AtomicFile
 from trac.util.text import printout, to_unicode, CRLF
-from trac.util.translation import _
+from trac.util.translation import _, N_
 __all__ = ['Configuration', 'Option', 'BoolOption', 'IntOption', 'FloatOption',
            'ListOption', 'ChoiceOption', 'PathOption', 'ExtensionOption',
 class ConfigurationError(TracError):
     """Exception raised when a value in the configuration file is not valid."""
-    title = 'Configuration Error'
+    title = N_('Configuration Error')
 class Configuration(object):
+def N_(string):
+    """No-op translation marker, inlined here to avoid importing from
+    `trac.util`.
+    """
+    return string
 class TracError(Exception):
     """Exception base class for errors in Trac."""
-    title = 'Trac Error'
+    title = N_('Trac Error')
     def __init__(self, message, title=None, show_traceback=False):
         """If message is a genshi.builder.tag object, everything up to the
         If title is given, it will be displayed as the large header above the
         error message.
+        from trac.util.translation import gettext
         Exception.__init__(self, message)
         self._message = message
-        if title:
-            self.title = title
+        self.title = title or gettext(self.title)
         self.show_traceback = show_traceback
     message = property(lambda self: self._message, 
     def __unicode__(self):
         return unicode(self.message)
 class Interface(object):
     """Marker base class for extension point interfaces."""


 class InvalidTicket(TracError):
     """Exception raised when a ticket fails validation."""
-    title = "Invalid Ticket"
+    title = N_("Invalid Ticket")
 class TicketModule(Component):
         # See trac/web/ for the definition of HTTPException subclasses.
         if env:
-        title = 'Error'
+        title = _('Error')
         if e.reason:
             if 'error' in e.reason.lower():
                 title = e.reason