Edgewall Software

Ticket #9354: msg-markup.2

File msg-markup.2, 1.4 KB (added by hasienda <hoff.st@…>, 2 years ago)

2nd version: mark text for translation with named substitutions

Line 
1# HG changeset patch
2# Parent 44edcf2a4a06c0b9d891e274267ee672f56ed29e
3
4diff --git a/tracopt/ticket/ticket_clone.py b/tracopt/ticket/ticket_clone.py
5--- a/tracopt/ticket/ticket_clone.py
6+++ b/tracopt/ticket/ticket_clone.py
7@@ -34,16 +34,17 @@
8         for f in data.get('fields', []):
9             name = f['name']
10             if name == 'summary':
11-                fields['summary'] = ticket['summary'] + " (cloned)"
12+                fields['summary'] = ticket['summary'] + _(" (cloned)")
13             elif name == 'description':
14-                fields['description'] = "Cloned from #%s: \n----\n%s" % \
15-                    (ticket.id, ticket['description'])
16+                fields['description'] = _("Cloned from #%(id)s:"
17+                    "\n----\n%(description)s", id=ticket.id,
18+                    description=ticket['description'])
19             else:
20                 fields[name] = ticket[name]
21         return tag.form(
22             tag.div(
23-                tag.input(type="submit", name="clone", value="Clone",
24-                    title="Create a copy of this ticket"),
25+                tag.input(type="submit", name="clone", value=_("Clone"),
26+                    title=_("Create a copy of this ticket")),
27                 [tag.input(type="hidden", name='field_'+n, value=v) for n, v in
28                     fields.items()],
29                 tag.input(type="hidden", name='preview', value=''),