Edgewall Software
Modify

Opened 10 years ago

Closed 9 years ago

#8055 closed defect (fixed)

i18n for ticket field names

Reported by: kabuchan@… Owned by: Christian Boos
Priority: normal Milestone: 0.12
Component: i18n Version: none
Severity: normal Keywords: i18n
Cc: felix.schwarz@… Branch:
Release Notes:
API Changes:

Description (last modified by Christian Boos)

Hi

Can not extract and translate like this.

trac/ticket/templates/ticket.html line 312

                 <label for="field-${field.name}" py:if="field"
                         py:strip="field.type == 'radio'">${field.edit_label or field.label or field.name}:</label>

Type:,Priority:,Milestone:,Milestone:,Version:,Severity: ,Keywords:,Cc:

trac/ticket/templates/ticket.html line 400
          <input type="submit" name="preview" value="${_('Preview')}" accesskey="r" />&nbsp;
          <input type="submit" name="submit" value="${ticket.exists and 'Submit changes' or 'Create ticket'}" />
        </div>
  • trac/ticket/templates/ticket.html

     
    397397            <input type="hidden" name="cnum" value="${cnum}" />
    398398          </py:if>
    399399          <input type="submit" name="preview" value="${_('Preview')}" accesskey="r" />&nbsp;
    400           <input type="submit" name="submit" value="${ticket.exists and 'Submit changes' or 'Create ticket'}" />
     400          <input type="submit" name="submit" value="${ticket.exists and _('Submit changes') or _('Create ticket')}" />
    401401        </div>
    402402
    403403      </form>

and can not translate messages including tag.

#: trac/admin/templates/admin_components.html:42
msgid ""
"Description (you may use\n"
"                [1:WikiFormatting]\n"
"                here):"

#: trac/admin/templates/admin_milestones.html:55
#: trac/admin/templates/admin_versions.html:35
#: trac/ticket/templates/milestone_edit.html:85
msgid "Description (you may use [1:WikiFormatting] here):"

#: trac/templates/error.html:131
msgid ""
"Before you do that, though, [1:please first try\n"
"                [2:searching]\n"
"                for similar issues], as it is quite likely that this "
"problem\n"
"                has been reported before. For questions about "
"installation\n"
"                and configuration of Trac, please try the\n"
"                [3:mailing list]\n"
"                instead of filing a ticket."

#: trac/ticket/templates/report_edit.html:25
msgid "Description: (you may use [1:WikiFormatting] here)"

#: trac/ticket/templates/ticket.html:266
msgid ""
"Comment (you may use\n"
"              [1:WikiFormatting]\n"
"              here):"

#: trac/timeline/templates/timeline.html:20
msgid ""
"[1:View changes from [2:]] [3:]\n"
"        and [4:[5:] days back][6:]\n"
"        [7:done by [8:]]"

#: trac/wiki/templates/wiki_edit.html:87
msgid ""
"[1:Note:] See [2:WikiFormatting] and\n"
"          [3:TracWiki] for help on editing wiki content."

Attachments (2)

ticket_localize.patch (2.0 KB ) - added by millerdev@… 10 years ago.
Fixes localization field names in ticket view.
ticket_localize_2.patch (5.1 KB ) - added by millerdev@… 10 years ago.
Better ticket localization

Download all attachments as: .zip

Change History (14)

in reply to:  description comment:1 by Christian Boos, 10 years ago

Description: modified (diff)
Keywords: i18n added
Milestone: 0.12
Owner: set to Christian Boos
Summary: i18n bugsi18n for ticket field names

Replying to kabuchan@…:

Can not extract and translate like this.

trac/ticket/templates/ticket.html line 312

<label for="field-${field.name}" py:if="field"

py:strip="field.type == 'radio'">${field.edit_label or field.label or field.name}:</label>

Type:,Priority:,Milestone:,Milestone:,Version:,Severity: ,Keywords:,Cc:

Yes, translation of ticket field names is still an open point. Let's use this ticket as a reminder for this.

Note also that in general, when there's something written "<some text>:", then the ':' must be part of the string to be translated, as different languages have different typographic rule (e.g. in French that would be translated to "<un texte> :").

<input type="submit" name="preview" value="${_('Preview')}" accesskey="r" />&nbsp;

  • <input type="submit" name="submit" value="${ticket.exists and 'Submit changes' or 'Create ticket'}" />

+ <input type="submit" name="submit" value="${ticket.exists and _('Submit changes') or _('Create ticket')}" />

…just an example among many :-) Thanks. There's still an awful lot of places where messages should be recomposed in order to lead to meaningful translations.

and can not translate messages including tag.

#: trac/admin/templates/admin_components.html:42 msgid "" "Description (you may use\n" " [1:WikiFormatting]\n" " here):"

I don't understand what you mean. Are you saying that those messages don't get translated? If so, are you using the proper versions of the supporting packages, i.e. Genshi advanced-i18n branch and Babel 0.9.4? (see TracL10N#GettingtheToolChain for pointers).

comment:2 by kabuchan@…, 10 years ago

I try genshi/advanced-i18n.It can translated. Thank you.

system info Trac: 0.12dev-r7828 Python: 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] setuptools: 0.6c9 SQLite: 3.3.4 pysqlite: 2.3.2 Genshi: 0.6dev-r994 ( → branches/experimental/advanced-i18n/) Babel: 1.0dev-r467 mod_python: 3.3.1 Subversion: 1.5.5 (r34862) jQuery: 1.2.6

comment:3 by Christian Boos, 10 years ago

Component: generali18n

comment:4 by Christian Boos, 10 years ago

Depends on #3919.

comment:5 by Remy Blank, 10 years ago

Wasn't that fixed in #3919 as well?

comment:6 by Christian Boos, 10 years ago

Right, but this needs to be redone (ticket:5474#comment:38), and I'll need to verify all the points from comment:1.

by millerdev@…, 10 years ago

Attachment: ticket_localize.patch added

Fixes localization field names in ticket view.

comment:7 by millerdev@…, 10 years ago

Just attached a patch that localizes the field names in the ticket view.

in reply to:  7 comment:8 by Christian Boos, 10 years ago

Status: newassigned

Replying to millerdev@…:

Just attached a patch that localizes the field names in the ticket view.

Thanks! I committed it in r8953. As I said in comment:6 above, this will change again, but that doesn't mean we can't fix the current status in the meantime, especially when we get a patch ;-)

comment:9 by millerdev@…, 10 years ago

OK, I don't know French, but I think you said the labels should be changed directly in the fields of the ticket object. Is that right? If so, I'll revise my patch to do that instead.

in reply to:  9 comment:10 by Christian Boos, 10 years ago

Replying to millerdev@…:

OK, I don't know French, but I think you said the labels should be changed directly in the fields of the ticket object. Is that right?

Yes, actually the original solution with field_labels instead of fields was done because fields had to be left unchanged across requests. Now that we make a deep copy of fields for each request, we can freely modify it, so no need for field_labels anymore.

by millerdev@…, 10 years ago

Attachment: ticket_localize_2.patch added

Better ticket localization

comment:11 by Felix Schwarz <felix.schwarz@…>, 9 years ago

Cc: felix.schwarz@… added

comment:12 by Christian Boos, 9 years ago

Description: modified (diff)
Resolution: fixed
Status: assignedclosed

Change similar to the above patch committed as r9230, including "typographic" localization mentioned in comment:1.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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