Commits

Anonymous committed 521caa8

i18n: Added a few missing translation markers.

Comments (0)

Files changed (6)

trac/admin/templates/admin_enums.html

       <py:otherwise>
         <form class="addnew" id="addenum" method="post" action="">
           <fieldset>
-            <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>
             </div>

trac/admin/templates/admin_plugins.html

     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:xi="http://www.w3.org/2001/XInclude"
-      xmlns:py="http://genshi.edgewall.org/">
+      xmlns:py="http://genshi.edgewall.org/"
+      xmlns:i18n="http://genshi.edgewall.org/i18n">
   <xi:include href="admin.html" />
   <head>
     <title>Plugins</title>
       <fieldset>
         <legend>Install Plugin:</legend>
         <div class="field">
-          <label>
+          <label i18n:msg="">
             File: <input type="file" name="plugin_file" disabled="${readonly or None}" />
           </label>
         </div>
 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):
            'TracError']
 
 
+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."""
 

trac/ticket/web_ui.py

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