Modify ↓
#13079 closed defect (fixed)
Label of custom field should not be translated in ticket view
| Reported by: | Jun Omae | Owned by: | Jun Omae |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.2.4 |
| Component: | ticket system | Version: | 1.0.17 |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: |
Do not translate custom field's labels. |
||
| API Changes: | |||
| Internal Changes: | |||
Description
After configuring the following, Due label is unintentionally translated in ticket view.
[ticket-custom] duedate = text duedate.label = Due
$ curl -s -H 'Accept-Language: en-us' http://127.0.0.1:3000/tracenv/newticket | grep -F ' for="field-duedate"'
<label for="field-duedate">Due:</label>
$ curl -s -H 'Accept-Language: de' http://127.0.0.1:3000/tracenv/newticket | grep -F ' for="field-duedate"'
<label for="field-duedate">Fällig:</label>
$ curl -s -H 'Accept-Language: ja' http://127.0.0.1:3000/tracenv/newticket | grep -F ' for="field-duedate"'
<label for="field-duedate">期日:</label>
$ curl -s -H 'Accept-Language: ko' http://127.0.0.1:3000/tracenv/newticket | grep -F ' for="field-duedate"'
<label for="field-duedate">완료 기한:</label>
I don't think a user is getting expected label by that behavior.
-
trac/ticket/api.py
diff --git a/trac/ticket/api.py b/trac/ticket/api.py index c97b82d7a..1afc0558a 100644
a b class TicketSystem(Component): 308 308 fields = copy.deepcopy(self.fields) 309 309 label = 'label' # workaround gettext extraction bug 310 310 for f in fields: 311 f[label] = gettext(f[label]) 311 if not f.get('custom'): 312 f[label] = gettext(f[label]) 312 313 return fields 313 314 314 315 def reset_ticket_fields(self):
Attachments (0)
Change History (3)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
| Milestone: | next-stable-1.2.x → 1.2.4 |
|---|---|
| Owner: | set to |
| Status: | new → assigned |
I get unexpected translated label for Branch custom field here.
comment:3 by , 7 years ago
| Release Notes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.



The change looks good.
Regarding translation of ticket custom field labels, the only open ticket I see where it's discussed is #9648.