Re: Variables placheholders comment
- From: Shaun McCance <shaunm gnome org>
- To: dooteo <dooteo zundan com>
- Cc: gnome-i18n gnome org
- Subject: Re: Variables placheholders comment
- Date: Wed, 30 Mar 2011 09:39:29 -0400
On Mon, 2011-03-28 at 17:54 +0200, dooteo wrote:
> Hi all,
>
> There is a comment into gnome-packagekit which makes me doubt about my
> faith in gettext.
>
> Here is the comment:
>
> #. TRANSLATOR: "%i %s %i %s" are "%i minutes %i seconds"
> #. * Swap order with "%2$s %2$i %1$s %1$i if needed
> #. TRANSLATOR: "%i %s %i %s" are "%i hours %i minutes"
> #. * Swap order with "%2$s %2$i %1$s %1$i if needed
>
> but, as far as I know, swap order (if translation needs) should be:
>
> %4$s %3$i %2$s %1$i (which outputs such as 'seconds number minutes
> number' message)
>
> So, placeholders should be unique. Am I wrong?
Right, the two messages are distinct, but they're merged
because they have the same msgid. If your language does
something like "# minutes # hours" but then something
else like "# (#) minutes (seconds)", this won't work.
That's why we have msgctxt. Developers should use it
in cases like this.
--
Shaun
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]