Bug 106280 - Please use ngettext for handling plurals in rhn-applet
Please use ngettext for handling plurals in rhn-applet
Product: Red Hat Linux Beta
Classification: Retired
Component: rhn-applet (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Robin Norwood
Brandon Perkins
Depends On:
Blocks: 106150
  Show dependency treegraph
Reported: 2003-10-04 15:11 EDT by Christian Rose
Modified: 2007-07-26 20:18 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-07-26 20:18:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Christian Rose 2003-10-04 15:11:52 EDT
#: rhn_applet.py:571
#, python-format
msgid "%d updates available (%d ignored)"

#: rhn_applet.py:573
#, python-format
msgid "%d update available (%d ignored)"

#: rhn_applet.py:581
#, python-format
msgid "No updates available (%d ignored)"

As mentioned in
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),

Something similar should work in Python 2.3 too.
Comment 1 Daniel Veillard 2003-10-04 15:50:03 EDT
fedora core stays with python 2.2 for now. So, assuming I understand your
report correctly, this means this will have to be done after the next release.

Comment 2 Christian Rose 2003-10-04 16:40:36 EDT
If that's the case, yes.
Comment 3 Daniel Veillard 2003-10-04 17:38:46 EDT
Okay so target would be the next version of Fedora Core (assuming things
go as planned).

Do you have some kind of patch ? The URL indicates how to do this from C
but not how to do it from python, it seems you know how to do this and
that would save me some time then needed. A pointer is fine.


Comment 4 Christian Rose 2003-10-09 15:03:55 EDT
http://www.python.org/doc/current/lib/node268.html :

  "ngettext(  singular, plural, n)

      Like gettext(), but consider plural forms. If a translation is found,
   apply the plural formula to n, and return the resulting message (some
   languages have more than two plural forms). If no translation is found,
   return singular if n is 1; return plural otherwise.

      The Plural formula is taken from the catalog header. It is a C or Python
   expression that has a free variable n; the expression evaluates to the
   index of the plural in the catalog. See the GNU gettext documentation for
   the precise syntax to be used in .po files, and the formulas for a variety
   of languages.

      New in version 2.3."
Comment 5 Christian Rose 2003-10-09 15:08:42 EDT
That's the best I can do -- I don't know Python, and I don't know where to look
for recent enough rhn-applet code.
Comment 6 Bill Nottingham 2006-08-07 11:55:37 EDT
Red Hat Linux is no longer supported by Red Hat, Inc. If you are still running
Red Hat Linux, you are strongly advised to upgrade to a current Fedora Core
release or Red Hat Enterprise Linux or comparable. Some information on which
option may be right for you is available at

Red Hat apologizes that these issues have not been resolved yet. We do want to
make sure that no important bugs slip through the cracks. Please check if this
issue is still present in a current Fedora Core release. If so, please change
the product and version to match, and check the box indicating that the
requested information has been provided. Note that any bug still open against
Red Hat Linux by the end of 2006 will be closed as 'CANTFIX'. Thanks again for
your help.
Comment 8 Red Hat Bugzilla 2007-04-11 20:07:00 EDT
User bnackash@redhat.com's account has been closed
Comment 9 Bill Nottingham 2007-07-26 20:18:23 EDT
Closing as CANTFIX.

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