Translating plural forms with different c-formats



Hi,

My language has no plural form. And I recently got some
complaint that having more than one msgstr[] while
declaring nplurals=1 blocks the build due to  gettext error.
So, I try to examine if there are other such errors left in
any other packages.

Actually, gedit was the one that gave me the impression
of the needs to keep multiple msgstr[] entries, even if
nplurals is 1.

For example:

#: ../gedit/dialogs/gedit-close-confirmation-dialog.c:451
#: ../gedit/dialogs/gedit-close-confirmation-dialog.c:472
#, c-format
msgid "If you don't save, changes from the last hour will be permanently lost."
msgid_plural ""
"If you don't save, changes from the last %d hours will be permanently lost."

This comes from the merge of two string occurrences, one is c-format
and the other is not:

#: ../gedit/dialogs/gedit-close-confirmation-dialog.c:451
               secondary_msg = g_strdup (_("If you don't save,
changes from the last hour "
                                                   "will be
permanently lost."));

and:

#: ../gedit/dialogs/gedit-close-confirmation-dialog.c:472
               secondary_msg = g_strdup_printf (
                                       ngettext ("If you don't save,
changes from the last hour "
                                                 "will be permanently lost.",
                                                 "If you don't save,
changes from the last %d hours "
                                                 "will be permanently lost.",
                                                 hours),
                                       hours);

So, if I have to choose only one translation, one of the two
will be messed up. That is, with %d in the translation, the former
case will confuse user with "%d" appearing in the string;
without %d, the latter will loose the number information.

The same appears here as well:
#: ../gedit/gedit-commands-file.c:1184 ../gedit/gedit-commands-file.c:1205

How should I do with this?

--
Theppitak Karoonboonyanan
http://linux.thai.net/~thep/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]