RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 820743 - some multiline strings extracted into string catalog incorrectly
Summary: some multiline strings extracted into string catalog incorrectly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Adrian Likins
QA Contact: Entitlement Bugs
URL:
Whiteboard:
Depends On:
Blocks: 738066 832111
TreeView+ depends on / blocked
 
Reported: 2012-05-10 20:35 UTC by Adrian Likins
Modified: 2012-06-20 12:57 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 832111 (view as bug list)
Environment:
Last Closed: 2012-06-20 12:57:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0804 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2012-06-19 19:51:31 UTC

Description Adrian Likins 2012-05-10 20:35:50 UTC
Several strings were constructed with the format"

blah = _("something first line blah" +
         "this is another line")

Unfortunately, the string extraction tool (xgettext) doesn't understand
this formatting, and only extracts the first line of the msg for
the string catalog. 

So, the strings are incorrect in the string catalog, and only the
first line ever get's translated. 

Worse, at runtime, the "" + "" does get evaluated, so the string
gettext ask's for translations of is the first msg, which doesn't
not exist in the strings file. So, it show's up as the entire
string being untranslated.

We've got a couple of cases where we can truncate after the
first line, and use a workable firstline of the message, that
is translated, and will match for the translations. 

We also have some cases where it doesn't really make any sense
that way. Not sure the best approach for that is. A untranslated
full msg, or a translated partial msg. 


src/subscription_manager/managercli.py
632:            systemExit(-1, _("ERROR: The service-level command is not supported by " + \
638:        not_supported = _("ERROR: The service-level command is not supported by " + \
1138:                        systemExit(-1, _("ERROR: The --servicelevel option is not " + \
                                         "supported by the server. Did not perform " + \
                                         "autosubscribe."))
1221:                            print _("This machine has been unsubscribed from subscription " +
                                       "with serial number %s" % (self.options.serial))

src/subscription_manager/gui/importsub.py
85:            errorWindow(_("An error occurred while importing the certificate. " +

Comment 2 Adrian Likins 2012-05-11 14:26:18 UTC
commit 2678039648eca87fc904d507910cdc412c085cea
Author: Adrian Likins <alikins>
Date:   Fri May 11 10:18:16 2012 -0400

    820743: fix some merge errors from fix for 820743

commit f4ddefd5989760d4b62a754d850c60582012b20f
Author: Adrian Likins <alikins>
Date:   Thu May 10 16:15:36 2012 -0400

    820743: some multiline strings extracted into string catalog incorrectly
    
    So truncate these cases so we get at least a partial match.

in 0.99.18 or newer

Comment 6 John Sefler 2012-05-22 14:31:26 UTC
My strategy to verify this bug is to determine exactly what msgids in the source code are affected.  To do this, I'll git show the commit hashes in comment 2 to determine the affected msgids and then go to the translation files and make sure there is a translation for them...

[jsefler@jseflerT5400 subscription-manager]$ git branch
* RHEL6.3
  master
[jsefler@jseflerT5400 subscription-manager]$ git show f4ddefd5989760d4b62a754d850c60582012b20f | grep ^[+-]
--- a/src/subscription_manager/gui/importsub.py
+++ b/src/subscription_manager/gui/importsub.py
-            errorWindow(_("An error occurred while importing the certificate. " +
-                          "Please check log file for more information."),
+            errorWindow(_("An error occurred while importing the certificate. "),
--- a/src/subscription_manager/managercli.py
+++ b/src/subscription_manager/managercli.py
-                systemExit(-1, _("ERROR: The --servicelevel option is not supported " + \
-                                 "by the server. Did not perform autosubscribe."))
+                systemExit(-1, _("ERROR: The --servicelevel option is not supported ")
-                    print(_("An error occurred while importing the certificate. " +
-                                  "Please check log file for more information."))
+                    print(_("An error occurred while importing the certificate. ")
[jsefler@jseflerT5400 subscription-manager]$ 

[jsefler@jseflerT5400 subscription-manager]$ git show 2678039648eca87fc904d507910cdc412c085cea | grep ^[+-]
--- a/src/subscription_manager/managercli.py
+++ b/src/subscription_manager/managercli.py
-                systemExit(-1, _("ERROR: The --servicelevel option is not supported ")
+                systemExit(-1, _("ERROR: The --servicelevel option is not supported "))
-                    print(_("An error occurred while importing the certificate. ")
+                    print(_("An error occurred while importing the certificate. "))


Now i know that the original msgids that xgettext was not extracting completely have been modified to be:

"An error occurred while importing the certificate. "
"ERROR: The --servicelevel option is not supported "

Let's spotcheck a few translation files and assert these msgids have been translated...


[root@qe-blade-09 ~]# rpm -ql subscription-manager | grep rhsm.mo/usr/share/locale/as/LC_MESSAGES/rhsm.mo
/usr/share/locale/bn/LC_MESSAGES/rhsm.mo
/usr/share/locale/de/LC_MESSAGES/rhsm.mo
/usr/share/locale/es/LC_MESSAGES/rhsm.mo
/usr/share/locale/fr/LC_MESSAGES/rhsm.mo
/usr/share/locale/gu/LC_MESSAGES/rhsm.mo
/usr/share/locale/hi/LC_MESSAGES/rhsm.mo
/usr/share/locale/it/LC_MESSAGES/rhsm.mo
/usr/share/locale/ja/LC_MESSAGES/rhsm.mo
/usr/share/locale/kn/LC_MESSAGES/rhsm.mo
/usr/share/locale/ko/LC_MESSAGES/rhsm.mo
/usr/share/locale/ml/LC_MESSAGES/rhsm.mo
/usr/share/locale/mr/LC_MESSAGES/rhsm.mo
/usr/share/locale/or/LC_MESSAGES/rhsm.mo
/usr/share/locale/pa/LC_MESSAGES/rhsm.mo
/usr/share/locale/pt/LC_MESSAGES/rhsm.mo
/usr/share/locale/pt_BR/LC_MESSAGES/rhsm.mo
/usr/share/locale/ru/LC_MESSAGES/rhsm.mo
/usr/share/locale/ta/LC_MESSAGES/rhsm.mo
/usr/share/locale/te/LC_MESSAGES/rhsm.mo
/usr/share/locale/zh_CN/LC_MESSAGES/rhsm.mo
/usr/share/locale/zh_TW/LC_MESSAGES/rhsm.mo
[root@qe-blade-09 ~]# 

[root@qe-blade-09 ~]# msgunfmt /usr/share/locale/zh_TW/LC_MESSAGES/rhsm.mo | grep "An error occurred while importing the certificate. " -A1
msgid "An error occurred while importing the certificate. "
msgstr "匯入認證時發生錯誤。"
[root@qe-blade-09 ~]# msgunfmt /usr/share/locale/fr/LC_MESSAGES/rhsm.mo | grep "An error occurred while importing the certificate. " -A1
msgid "An error occurred while importing the certificate. "
msgstr "Une erreur s'est produite lors de l'importation du certificat."
[root@qe-blade-09 ~]# 

^^^ VERIFIED: The simplified msgid "An error occurred while importing the certificate. " appears translated.


[root@qe-blade-09 ~]# msgunfmt /usr/share/locale/te/LC_MESSAGES/rhsm.mo | grep "ERROR: The --servicelevel option is not supported " -A1
msgid "ERROR: The --servicelevel option is not supported "
msgstr "దోషం: --servicelevel ఐచ్చికం తోడ్పాటు నిచ్చుటలేదు"
[root@qe-blade-09 ~]# msgunfmt /usr/share/locale/it/LC_MESSAGES/rhsm.mo | grep "ERROR: The --servicelevel option is not supported " -A1
msgid "ERROR: The --servicelevel option is not supported "
msgstr "ERRORE: L'opzione --servicelevel non è supportata"
[root@qe-blade-09 ~]# 

^^^ VERIFIED: The simplified msgid "ERROR: The --servicelevel option is not supported " appears translated.

Moving status to VERIFIED
[root@qe-blade-09 ~]# rpm -q subscription-manager
subscription-manager-0.99.18-1.el6.x86_64

Note... As indicated in comment 0, these fixes only help the few strings were the partial msgid conveys a complete thought.  For other cases that were not fixed, an untranslated full msg will be displayed to the user.  This should get fixed in future releases of subscription-manager by enforcing a coding style that xgettext does not fail to extract.

Comment 8 errata-xmlrpc 2012-06-20 12:57:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0804.html


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