Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

#8588 closed defect (fixed)

L10n in progress_bar

Reported by: Kirikaza <kirikaza@…> Owned by: Christian Boos
Priority: normal Milestone: 0.12
Component: i18n Version: none
Severity: normal Keywords: progress_bar
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The progress_bar macro can't be localized. So I have "Closed Tickets:" in Roadmap regardless of the selected language.

Let's look at macros.html:236: …${interval.title.capitalize()} ${stats.unit}s:

Here the ${interval.title} contains "closed" or "active".

I suggest add _(): _(${interval.title.capitalize())

And we should repeat this change on the next line (237).

It works well!

But… It is not very good for any language. Look at this: "Closed tickets" and "Closed ticket". E.g., in Russian it will be "Zakrytye zadachi" and "Zakrytaya zadacha". So we can't use the common "Closed" here. We need translate the whole sentence!

I change the code to: ${_(interval.title.capitalize() + ' ' + stats.unit + 's:')} so I translate the whole "Closed tickets:"

Also we should change the line 245 to translate "Total tickets:". We can see there

Total ${stats.unit}s.

It's unlocalizable! As I need translate the whole phrase, I fix the line so:

${_('Total ' + stats.unit + 's:')}

Attachments (0)

Change History (8)

comment:1 by Jeroen Ruigrok van der Werven, 15 years ago

Owner: set to Jeroen Ruigrok van der Werven
Status: newassigned

Some good points, I'll make sure to push through some of these changes tonight. The English part of just tacking on an s is a bit dirty as well.

comment:2 by Christian Boos, 15 years ago

Milestone: 0.12
Owner: changed from Jeroen Ruigrok van der Werven to Christian Boos
Status: assignednew

comment:3 by Christian Boos, 15 years ago

Resolution: fixed
Status: newclosed

This got fixed in r8904.

Sorry Kirikaza, but most of the advices given in the #comment:description were not usable, as the translation mechanism simply doesn't work like this: what's given in _(…) must be a format string, not an expression.

Your point about "ticket closed" vs. "tickets closed" was correct, but specifying all the forms for ticket statuses and guessing the grammar would be just as error prone as adding an "s" for the plural…

Look at the french translation to see how workarounds can be found: source:trunk/trac/locale/fr_FR/LC_MESSAGES/messages.po@8904:2077-2096#L2067 (unit is 'ticket', units is 'tickets' and title is 'closed')

comment:4 by Christian Boos, 15 years ago

Resolution: fixed
Status: closedreopened

Need to have a second look into this, apparently having different parameters in singular/plural forms is not OK, at least not for msgfmt.

comment:5 by mrelbe <mikael@…>, 15 years ago

The Swedish language also becomes problematic regarding this topic (I guess this is problematic for most, if not all, languages).

What about the following informal layout of the progress bar, which is to not add the word "Ticket" after the ticket state name:

Tickets:   Closed: 2    Assigned: 12    /    Total: 14

The only word needing translation is then the leading "Tickets", plural if Total>1, singular otherwise, and the problem of combining that word with ticket state names has vanished.

in reply to:  5 comment:6 by mrelbe <mikael@…>, 15 years ago

Replying to mrelbe:

The only word needing translation is then…

Wrong: the word "Total" still needs to be translated, of course.

comment:7 by Christian Boos, 15 years ago

And there's the typographical part, "<status>:" translates to "<status> :" in French…

comment:8 by Christian Boos, 15 years ago

Resolution: fixed
Status: reopenedclosed

Thanks to Mikael's suggestion, I approached the problem differently. This time, the translations are quite fine IMO, and simpler even.

Issue should be fixed by r9498. Please try it out.

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'.
to The owner will be changed from Christian Boos 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.