Red Hat Bugzilla – Bug 251891
yum info does not translate descriptions of remote packages
Last modified: 2014-01-21 17:59:02 EST
When yum info lists packages from remote repositories, the summary and
description strings are not localized, though the translations are available, in
the catalogues provided by the specspo package.
Note that the summary an description fields change only infrequently, so it is
probable that the translations from previous specspo are still usable.
on an F7 system with lang cs_CZ.UTF-8, "yum install pam-devel" returns two
descriptions of the very same version of the package: under the header
"Installed Packages," the summary and description are translated, while under
the header " " they are not. Yum should call gettext to translate the latter.
Sorry for a typo in the original description:
[...] while under the header "Available Packages" they are not. Yum should call
gettext to translate [them].
if you just download the pam-devel package which is listed in 'Available
Packages' but you do not install it - if you run:
rpm -qpi on that package is the information there translated?
Part of the problem here is that the i18ndomains definition used by rpm to
decide what domain to use isn't exported at all, so we'd have to just go with
something hardcoded like redhat-dist, which really isn't what you want.
Something like the following will work once we can get the info from rpm...
[katzj@aglarond yum]$ git diff output.py |cat
diff --git a/output.py b/output.py
index 6973ded..33f61e2 100644
@@ -20,6 +20,7 @@
from i18n import _
from urlgrabber.progress import TextMeter
@@ -39,6 +40,8 @@ class YumOutput:
self.logger = logging.getLogger("yum.cli")
self.verbose_logger = logging.getLogger("yum.verbose.cli")
+ # FIXME: this should be dynamic and based on the rpm macro
+ self.i18ndomains = ["redhat-dist"]
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
@@ -68,9 +71,14 @@ class YumOutput:
def infoOutput(self, pkg):
- # this sucks. what we get back from the rpmdb
- # are strings, but they may actually have unicode so we
- # can't encode them
+ """Get the translated version from specspo and ensure that
+ it's actually encoded in UTF-8."""
+ if len(s) > 0:
+ for d in self.i18ndomains:
+ t = gettext.dgettext(d, s)
+ if t != s:
+ s = t
if type(s) == unicode:
https://lists.dulug.duke.edu/pipermail/rpm-maint/2007-August/000511.html is a
patch to export rpmExpand to the python bindings
(In reply to comment #2)
> if you just download the pam-devel package which is listed in 'Available
> Packages' but you do not install it - if you run:
> rpm -qpi on that package is the information there translated?
(I removed pam-devel from my system and verified that rpm -qpi still translates
the strings using the catalogue from the specspo package.
rpm patch went in, so committed change to yum to do this