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 307560 - Should use ngettext for a string
Should use ngettext for a string
Status: RESOLVED FIXED
Product: gnome-screensaver
Classification: Deprecated
Component: general
unspecified
Other Linux
: High normal
: ---
Assigned To: gnome-screensaver maintainers
gnome-screensaver maintainers
Depends on:
Blocks:
 
 
Reported: 2005-06-13 20:39 UTC by Vincent Untz
Modified: 2005-06-14 15:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.12 KB, patch)
2005-06-14 13:05 UTC, Thierry Moisan
needs-work Details | Review

Description Vincent Untz 2005-06-13 20:39:10 UTC
#: ../src/gs-lock-plug.c:239
#, c-format
msgid "About %ld seconds left"

Using ngettext here to handle the plural would be nice ;-) (yes, I know that
there's only one case when it's not plural)
Comment 1 Thierry Moisan 2005-06-13 23:01:15 UTC
There is some documentation on the ngettext function at
http://www.ccr.jussieu.fr/ccr/Documentation/Calcul/gettext/ngettext.3.html
but i don't really understand how to implement this. I tried this :
message = g_strdup_printf (_(ngettext ("About %ld second left", "About %ld
seconds left", n), n),
is it ok? it is said that we need to pass the integer (n in this case) to the
g_strdup_printf function. How can I do that?
Comment 2 Thierry Moisan 2005-06-14 13:05:38 UTC
Created attachment 47755 [details] [review]
proposed patch

I added the ngettext thing. I couldn't test the patch so please test it before
commiting.
Comment 3 William Jon McCann 2005-06-14 15:08:16 UTC
Comment on attachment 47755 [details] [review]
proposed patch

Thanks for the patch.  There are only a few minor things wrong with it.

- the spacing isn't consistent with the rest of the code
- secs_remaining should be a long type
- secs_remaining is a little bit too verbose, secs will suffice
Comment 4 William Jon McCann 2005-06-14 15:09:58 UTC
Committed with those minor changes.  Thanks!

2005-06-14  William Jon McCann  <mccann@jhu.edu>

	* src/gs-lock-plug.c (monitor_progress): Use ngettext to handle
	plurals.  Fixes #307560.

	Based on patch by Thierry Moisan <thierryn@videotron.ca>