After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 522334 - ngettext() required for numeric places
ngettext() required for numeric places
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gcalctool maintainers
gcalctool maintainers
Depends on:
Blocks:
 
 
Reported: 2008-03-13 23:17 UTC by Marcel Telka
Modified: 2008-03-14 11:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to hopefully fix the problem. (840 bytes, patch)
2008-03-14 10:59 UTC, Rich Burridge
committed Details | Review

Description Marcel Telka 2008-03-13 23:17:25 UTC
This is in POT file:

#. Translators: The accuracy range will always be plural, so no need to
#. *             use ngettext here.
#.
#: ../gcalctool/gtk.c:549
#, c-format
msgid "Set accuracy from 0 to %d numeric places."
msgstr ""


The problem is that actual translation of this message depends on number in %d. For example in Slovak language we would have translated:

"4 places" as "4 miesta"
"5 places" as "5 miest"

Please, use ngettext() for this message too to allow proper translation of this message to Slovak.

Thank you.
Comment 1 Rich Burridge 2008-03-14 02:47:47 UTC
Marcel, I need some advice here. For GNOME 2.22, the code in gtk.c for this
used to be:

    desc = g_strdup_printf(ngettext("Set accuracy from 0 to %d numeric places.",
                                    "Set accuracy from 0 to %d numeric places.",
                                    MAXACC),
                           MAXACC);

But we had another bug (bug #520269) saying that:


    From the current POT file:

    #: ../gcalctool/gtk.c:546
    msgid "Set accuracy from 0 to %d numeric places."
    msgid_plural "Set accuracy from 0 to %d numeric places."

    ...

    The singular and plural cases are the same, and I don't think this is correct.
    Surely the singular should be "place"? 

So which is it? Should both parts of the ngettext say:

"Set accuracy from 0 to %d numeric places.",
"Set accuracy from 0 to %d numeric places.",

or should it be:

"Set accuracy from 0 to %d numeric place.",
"Set accuracy from 0 to %d numeric places.",

?

Thanks.
Comment 2 Marcel Telka 2008-03-14 05:29:44 UTC
The documentation for ngettext() is saying:

 -- Function: char * ngettext (const char *MSGID1, const char *MSGID2,
          unsigned long int N)
     The `ngettext' function is similar to the `gettext' function as it
     finds the message catalogs in the same way.  But it takes two
     extra arguments.  The MSGID1 parameter must contain the singular
     form of the string to be converted.  It is also used as the key
     for the search in the catalog.  The MSGID2 parameter is the plural
     form.  The parameter N is used to determine the plural form.  If no
     message catalog is found MSGID1 is returned if `n == 1', otherwise
     `msgid2'.

So, you should use place/places variant to avoid confusion and questions in future. Even if you are sure that you are never going to use singular form of the string. This is the right way.

Links:
http://live.gnome.org/TranslationProject/DevGuidelines/Plurals
Comment 3 Rich Burridge 2008-03-14 10:59:49 UTC
Created attachment 107288 [details] [review]
Patch to hopefully fix the problem.

> So, you should use place/places variant to avoid confusion and questions in
> future. Even if you are sure that you are never going to use singular form of
> the string. This is the right way.

Okay. So changed. It just feels wrong to me.

Patch committed to SVN trunk. Closing as FIXED.

Thanks.