Edgewall Software

Opened 6 years ago

Closed 5 years ago

Last modified 4 months ago

#13079 closed defect (fixed)

Label of custom field should not be translated in ticket view — at Version 3

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):  
    308308        fields = copy.deepcopy(self.fields)
    309309        label = 'label' # workaround gettext extraction bug
    310310        for f in fields:
    311             f[label] = gettext(f[label])
     311            if not f.get('custom'):
     312                f[label] = gettext(f[label])
    312313        return fields
    313314
    314315    def reset_ticket_fields(self):

Change History (3)

comment:1 by Ryan J Ollos, 6 years ago

The change looks good.

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

comment:2 by Jun Omae, 5 years ago

Milestone: next-stable-1.2.x1.2.4
Owner: set to Jun Omae
Status: newassigned

I get unexpected translated label for Branch custom field here.

comment:3 by Jun Omae, 5 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed in [16836] and merged in [16837].

Note: See TracTickets for help on using tickets.