Bug 106195 - Please use ngettext for handling plurals in redhat-config-packages
Please use ngettext for handling plurals in redhat-config-packages
Status: CLOSED DEFERRED
Product: Red Hat Linux Beta
Classification: Retired
Component: redhat-config-packages (Show other bugs)
beta2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
David Lawrence
http://developer.gnome.org/doc/tutori...
:
Depends On:
Blocks: 106150
  Show dependency treegraph
 
Reported: 2003-10-03 11:40 EDT by Christian Rose
Modified: 2007-04-18 12:58 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-10-20 17:55:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Christian Rose 2003-10-03 11:40:31 EDT
#: src/InstallDruid.py:265
#, python-format
msgid "%d package is queued for installation\n"

#: src/InstallDruid.py:267 src/InstallProgressDialog.py:169
#, python-format
msgid "%d packages are queued for installation\n"

#: src/InstallDruid.py:269
#, python-format
msgid "%d package is queued for removal\n"

#: src/InstallDruid.py:271 src/InstallProgressDialog.py:171
#, python-format
msgid "%d packages are queued for removal\n"

#: src/size_string.py:7
msgid " Byte"

#: src/size_string.py:9
msgid " Bytes"

#: src/InstallProgressDialog.glade.h:4
#, no-c-format
msgid ""
"<span  weight=\"bold\" size=\"larger\">Completed system preparation</span>\n"
"\n"
"%d packages are queued for installation\n"
"%d packages are queued for removal\n"
"\n"
"This will take %s of diskspace."


As mentioned in
http://developer.gnome.org/doc/tutorials/gnome-i18n/developer.html#plurals,
this way of handling plurals is broken for many locales. A way to solve
this is by using ngettext instead as mentioned in that document.
A simple code example of code using ngettext:

  g_printf (ngettext ("Found %d file.", "Found %d files.", nbr_of_files),
nbr_of_files);

Something similar should work in Python too.
Comment 1 Jeremy Katz 2003-10-20 17:55:26 EDT
python 2.2 doesn't support ngettext.  2.3 does so will revisit then.

Note You need to log in before you can comment on or make changes to this bug.