Edgewall Software
Modify

Opened 7 years ago

Closed 7 years ago

#12867 closed defect (fixed)

General word "and" is not translateable.

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.3.2
Component: i18n Version: 1.3dev
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Attachments (0)

Change History (4)

comment:1 by Jun Omae, 7 years ago

<label>${_("between")}</label> and <label>${_("and")}</label>, <label> element with no control and no for attribute does nothing.

I think extracted messages would be simple and clear to modify to be the message with <label> elements:

  • trac/ticket/templates/query.html

    diff --git a/trac/ticket/templates/query.html b/trac/ticket/templates/query.html
    index 31931871f..e4a9926d1 100644
    a b  
    200200                                 value="${end}" size="14"
    201201                                 class="trac-${date_or_datetime}picker" />
    202202                          #   endset
    203                           #   set between_label
    204                           <label>${_("between")}</label>
    205                           #   endset
    206                           #   set and_label
    207                           <label>${_("and")}</label>
    208                           #   endset
    209                           #   trans between_label, and_label, start_picker, end_picker
     203                          #   trans start_picker, end_picker
    210204
    211                           ${between_label} ${start_picker}
    212                           ${and_label} ${end_picker}
     205                          <label>between ${start_picker}</label> <label>and ${end_picker}</label>
    213206
    214207                          #   endtrans
    215208                          # endif

comment:2 by Jun Omae, 7 years ago

Owner: set to Jun Omae
Status: newassigned

Revised proposed changes in [2753b29a5/jomae.git] (jomae.git@t12867).

query.js has the same issue. Proposed changes would fix this issue in both query.html and query.js.

in reply to:  1 comment:3 by Ryan J Ollos, 7 years ago

Replying to Jun Omae:

<label>${_("between")}</label> and <label>${_("and")}</label>, <label> element with no control and no for attribute does nothing.

Good find. I've tested and proposed changes look good to me.

comment:4 by Jun Omae, 7 years ago

Milestone: 1.3.31.3.2
Resolution: fixed
Status: assignedclosed

Thanks for the testing! Committed with additional changes in [16146].

The additional changes is to use jQuery.parseHTML(_("...")) to parse html explicitly rather than jQuery(_("...")). The localized string might not be started with <label>.

According to http://api.jquery.com/jQuery/#creating-new-elements:

If a string is passed as the parameter to $(), jQuery examines the string to see if it looks like HTML (i.e., it starts with <tag … >). If not, the string is interpreted as a selector expression, as explained above.

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.