[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: RFC: Out with %n in KDE4
From:       Nicolas Goutte <nicolasg () snafu ! de>
Date:       2006-07-15 13:32:37
Message-ID: 200607151532.38253.nicolasg () snafu ! de
[Download RAW message or body]

On Saturday 15 July 2006 14:32, Chusslove Illich wrote:
> > [: Nicolas Goutte :]
> > No please. %1 is Qt and not standard Gettext for plurals
> >
> > So again this would be a KDE-ism (and not even a Qt-ism) and therefore
> > you would again need a translation tools that knows about KDE. [...]
>
> Actually, in standard Gettext there is no concept of placeholder for
> plurals. Using pure Gettext calls, one has to specify plural-deciding
> argument separately from placeholder arguments, eg:
>
> printf(gettextn("%d file in %s.\n", "%d files in %s.\n", nfiles),
>        nfiles, dirpath);
>
> (note nfiles repeated twice, once to choose plural form, then to substitute
> the placeholder).
>
> Gettext however knows about several forms of placeholders, in order to do
> matching checks. Among them there is also qt-format, which will be set for
> messages with %number if xgettext is run with option -qt.
>
> So, by having only %numbers in messages, we would gain extra support from
> Gettext.

What I mean is that we must be very careful. 

GNU uses plural with printf, so perhaps some translation programs could assume 
that too. And especially as we do not know the state of KBabel (which is 
currently at 0% usability on KDE4, if nothing has changed in the meanwhile).

Also from the point of view of the translators, Gettext examples of plurals 
are with %d. And the more KDE4 has differences, the more we would have to 
explain.

Another point is that developer will continue to write "One item", "%n items" 
(be %n now be written %1 or %d in KDE4) like now, so that you do not have 
the %1 anymore. (How does msgfmt --check react with such a qt-format entry?)

>
> > My idea was more to replace it with %i (or %d) as %n is really a nasty
> > placeholder in a printf context.
> >
> > However you cannot remove it completely, as the translators have to tell
> > somehow: "here I want the number".
>
> It will always be that %1 is the plural-deciding argument.
>
> Even if not so, I can't think of an example when it was not clear which
> placeholder is the plural number. And even even, if something like that
> would happen, it would be lost in the sea of other ambiguous meanings that
> translators anyway face.

But we have many messages in KDE3 where you have %1, %2... and %n. How do you 
plan to convert those messages? (It is annoying, as it would mean that the 
conversion scripts must be more intelligent than they are currently.)

Have a nice day!
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic