Some strings require fixed order of variables: translation issue

Bug #176683 reported by sander
2
Affects Status Importance Assigned to Milestone
Coccinella
Fix Released
Wishlist
Mats

Bug Description

Some strings require a fixed order of variables. This makes a good translation in some languages (extremely) hard, if not impossible.

Examples:
Cannot read %s: %s
Cannot download file %s from %s.
etc

Solution: use different variables like this:
Cannot read %s: %t
Cannot download file %s from %t.
etc

URL: http://lists.jabber.ru/pipermail/ejabberd/2007-December/003298.html

sander (s-devrieze)
Changed in coccinella:
assignee: nobody → matsben
importance: Undecided → Wishlist
Revision history for this message
Mats (matsben) wrote : Re: [Bug 176683] Some strings require fixed order of variables: translation issue

There is a solution for this:

() 1 % format "This is the %s and %s attempt" FIRST SECOND
This is the FIRST and SECOND attempt
() 3 % format {This is the %2$s and %1$s attempt} FIRST SECOND
This is the SECOND and FIRST attempt

See: http://tcl.tk/man/tcl8.4/TclCmd/msgcat.htm#M18
and http://tcl.tk/man/tcl8.4/TclCmd/format.htm#M5

msgcat uses the 'format' command.
In short, the translator must add "positional codes".
Perhaps worth a note somewhere?

On 12/16/07, Launchpad Bug Tracker <email address hidden> wrote:
> You have been subscribed to a public bug:
>
> Some strings require a fixed order of variables. This makes a good
> translation in some languages (extremely) hard, if not impossible.
>
> Examples:
> Cannot read %s: %s
> Cannot download file %s from %s.
> etc
>
> Solution: use different variables like this:
> Cannot read %s: %t
> Cannot download file %s from %t.
> etc
>
> URL: http://lists.jabber.ru/pipermail/ejabberd/2007-December/003298.html
>
> ** Affects: coccinella
> Importance: Wishlist
> Assignee: Mats (matsben)
> Status: New
>
> --
> Some strings require fixed order of variables: translation issue
> https://bugs.launchpad.net/bugs/176683
> You received this bug notification because you are a bug assignee.
>

Revision history for this message
sander (s-devrieze) wrote :

> msgcat uses the 'format' command.
> In short, the translator must add "positional codes".
> Perhaps worth a note somewhere?

yes, on a very visible location :-)

Revision history for this message
Mats (matsben) wrote :

See, http://coccinella.im/translate
and coccinella/msgs/REAME_encodings

Changed in coccinella:
status: New → Fix Committed
Revision history for this message
sander (s-devrieze) wrote :

it's released, not committed :-)

Changed in coccinella:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.