Skip to content

Instantly share code, notes, and snippets.

@miau
Created March 15, 2010 02:38
Show Gist options
  • Save miau/332432 to your computer and use it in GitHub Desktop.
Save miau/332432 to your computer and use it in GitHub Desktop.
--- web_ui.py.org 2008-12-11 10:44:02.000000000 +0900
+++ web_ui.py 2008-12-11 11:56:44.000000000 +0900
@@ -11,6 +11,7 @@
from trac.web import IRequestHandler
from trac.util.datefmt import parse_date, to_timestamp
from trac.wiki import wiki_to_html
+from trac.util.translation import _
import re
import traceback
@@ -29,16 +30,16 @@
if filename == 'ticket.html' and req.authname != 'anonymous':
ticket = data.get('ticket')
if 'TICKET_ADMIN' in req.perm(ticket.resource):
- self.log.debug("TicketChangePlugin adding 'Change' links for ticket %s" % ticket.id)
+ self.log.debug("TicketChangePlugin adding '%s' links for ticket %s" % (_("Change"), ticket.id))
buffer = StreamBuffer()
def insert_change_link():
cnum = list(buffer)[0][1][1][0][1]
- return tag(" ", tag.a("Change", href=("../ticketchangecomment/%s?cnum=%s" % (ticket.id, cnum))))
+ return tag(" ", tag.a(_("Change"), href=("../ticketchangecomment/%s?cnum=%s" % (ticket.id, cnum))))
filter = Transformer("//div[@class='change']/div[@class='inlinebuttons']/input[@name='replyto']/@value")
return stream | filter.copy(buffer).end() \
- .select("//div[@class='change']/div[@class='inlinebuttons']/input[@value='Reply']") \
+ .select("//div[@class='change']/div[@class='inlinebuttons']/input[@value='%s']" % _("Reply")) \
.after(insert_change_link)
return stream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment