Edgewall Software
Modify

Opened 6 years ago

Closed 6 years ago

Last modified 10 months ago

#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):  
    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):

Attachments (0)

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, 6 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, 6 years ago

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

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.