Bug 552317 - RFE: please add plural forms support to text output
Summary: RFE: please add plural forms support to text output
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Zdeněk Pavlas
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 461824 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-04 16:56 UTC by Karel Volný
Modified: 2014-02-02 22:29 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-06-22 14:00:16 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Karel Volný 2010-01-04 16:56:48 UTC
Description of problem:
Yum outputs ugly strings like "0 Package(s)".
Please make use of the gettext plural forms feature so that the output is like "1 Package", "2 Packages" ...

Something like the following patch does part of the job, but there are more occurences that are not that straightforward and my Python skills are too poor to rewrite the code properly :-(

--- output.py~  2009-10-16 22:44:39.000000000 +0200
+++ output.py   2010-01-04 17:48:25.765449447 +0100
@@ -38,7 +38,7 @@
 from rpmUtils.miscutils import checkSignals
 from yum.constants import *

-from yum import logginglevels, _
+from yum import logginglevels, _, P_
 from yum.rpmtrans import RPMBaseCallback
 from yum.packageSack import packagesNewestByNameArch
 import yum.packages
@@ -1003,20 +1003,16 @@
         out.append(summary)
         num_in = len(self.tsInfo.installed + self.tsInfo.depinstalled)
         num_up = len(self.tsInfo.updated + self.tsInfo.depupdated)
-        summary = _("""\
-Install   %5.5s Package(s)
-Upgrade   %5.5s Package(s)
-""") % (num_in, num_up,)
+        summary = P_("""Install   %5.5s Package\n""", """Install   %5.5s Packages\n""", num_in) % (num_in)
+        summary += P_("""Upgrade   %5.5s Package\n""", """Upgrade   %5.5s Packages\n""", num_up) % (num_up)
         if num_in or num_up: # Always do this?
             out.append(summary)
         num_rm = len(self.tsInfo.removed + self.tsInfo.depremoved)
         num_re = len(self.tsInfo.reinstalled)
         num_dg = len(self.tsInfo.downgraded)
-        summary = _("""\
-Remove    %5.5s Package(s)
-Reinstall %5.5s Package(s)
-Downgrade %5.5s Package(s)
-""") % (num_rm, num_re, num_dg)
+        summary = P_("""Remove    %5.5s Package\n""", """Remove    %5.5s Packages\n""", num_rm) % (num_rm)
+        summary += P_("""Reinstall %5.5s Package\n""", """Reinstall %5.5s Packages\n""", num_re) % (num_re)
+        summary += P_("""Downgrade %5.5s Package\n""", """Downgrade %5.5s Packages\n""", num_dg) % (num_dg)
         if num_rm or num_re or num_dg:
             out.append(summary)

Comment 1 James Antill 2010-04-29 16:31:10 UTC
*** Bug 461824 has been marked as a duplicate of this bug. ***

Comment 2 Zdeněk Pavlas 2011-06-22 14:00:16 UTC
RFE has been implemented in upstream.

Comment 3 Karel Volný 2011-06-23 09:47:17 UTC
(In reply to comment #2)
> RFE has been implemented in upstream.

thanks!


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