Bug 106280 - Please use ngettext for handling plurals in rhn-applet
Summary: Please use ngettext for handling plurals in rhn-applet
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Red Hat Linux Beta
Classification: Retired
Component: rhn-applet
Version: beta2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Robin Norwood
QA Contact: Brandon Perkins
URL: http://developer.gnome.org/doc/tutori...
Whiteboard:
Depends On:
Blocks: 106150
TreeView+ depends on / blocked
 
Reported: 2003-10-04 19:11 UTC by Christian Rose
Modified: 2007-07-27 00:18 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-07-27 00:18:23 UTC
Embargoed:


Attachments (Terms of Use)

Description Christian Rose 2003-10-04 19:11:52 UTC
#: 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
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 2.3 too.

Comment 1 Daniel Veillard 2003-10-04 19:50:03 UTC
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.

Daniel

Comment 2 Christian Rose 2003-10-04 20:40:36 UTC
If that's the case, yes.

Comment 3 Daniel Veillard 2003-10-04 21:38:46 UTC
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.

  TIA,

Daniel

Comment 4 Christian Rose 2003-10-09 19:03:55 UTC
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 19:08:42 UTC
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 15:55:37 UTC
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
http://www.redhat.com/rhel/migrate/redhatlinux/.

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-12 00:07:00 UTC
User bnackash's account has been closed

Comment 9 Bill Nottingham 2007-07-27 00:18:23 UTC
Closing as CANTFIX.


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