Bug 2077759
| Summary: | [ALL LANG][RHSM Cockpit Client] Unlocalized windows title name 'Subscriptions'. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Lijun Li <lijli> |
| Component: | subscription-manager-cockpit | Assignee: | Pino Toscano <ptoscano> |
| Status: | CLOSED ERRATA | QA Contact: | John Sefler <jsefler> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 9.0 | CC: | cdonnell, jsefler, jstavel, jwboyer, ljanda, mmarusak, mpitt, redakkan, zpetrace |
| Target Milestone: | rc | Keywords: | i18n, Triaged |
| Target Release: | 9.2 | Flags: | pm-rhel:
mirror+
|
| Hardware: | x86_64 | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | subscription-manager-cockpit-5-1.el9 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-05-09 08:24:42 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Deadline: | 2023-03-28 | ||
|
Description
Lijun Li
2022-04-22 07:20:45 UTC
Hello Lijun Li, there should be a new version of the cockpit plugin available in 9.1 nightlies, subscription-manager-cockpit-2-1.el9. Would it be possible for you to check whether the issue is still reproducible in this new version? Thanks in advance! I see an unlocalized window title still.
PACKAGES TESTED:
subscription-manager-1.29.29+2.g765ad6609-1.git.0.b845bc0.x86_64
subscription-manager-cockpit-2^4.gc674aee-1.el9.noarch
subscription-manager-rhsm-certificates-20220623-1.el9.noarch
package subscription-manager-initial-setup-addon is not installed
package dnf-plugin-subscription-manager is not installed
python3-cloud-what-1.29.29+2.g765ad6609-1.git.0.b845bc0.x86_64
python3-subscription-manager-rhsm-1.29.29+2.g765ad6609-1.git.0.b845bc0.x86_64
package python3-syspurpose is not installed
package rhsm-gtk is not installed
rhsm-icons-2-1.el9.noarch
package subscription-manager-migration is not installed
package subscription-manager-migration-data is not installed
package subscription-manager-plugin-ostree is not installed
The window title is coming from the <title> HTMl attribute, in this case https://github.com/candlepin/subscription-manager-cockpit/blob/main/src/index.html#L22 The title is translated in both Japanese and Chinese: https://github.com/candlepin/subscription-manager-cockpit/blob/main/po/ja.po#L431 https://github.com/candlepin/subscription-manager-cockpit/blob/main/po/zh_CN.po#L423 However sub-man-cockpit is missing a call to cockpit.translate(), see https://cockpit-project.org/guide/latest/cockpit-locale.html#cockpit-translate Example: https://github.com/cockpit-project/cockpit/blob/main/pkg/sosreport/index.jsx#L541 Indeed starter-kit is missing that, I'll send a PR with a test. Pino: I tested that in starter-kit, c-{podman,machines}, and the window title is properly translated, at least in the browser (I didn't check in c-desktop, as that doesn't work on my machine and I don't have a graphical VM handy.) I sent https://github.com/cockpit-project/starter-kit/pull/596 to ensure it stays working, but TBH I can't currently say *why* it works (sorry, this would take some time, and I have about 5 other things to do right now.. please prod me again if you need details).
One difference in https://github.com/candlepin/subscription-manager-cockpit/blob/main/src/index.html compared to starter-kit and friends is that it loads the js scripts at the *end* of <body>, whereas every other cockpit project loads them in <head>. So I suggest: (1) try with cockpit.translate() -- at worst it's harmless, and (2) try to move the script order to see if that makes a difference.
I can reproduce this on my local rhel machine. I also tested different pages like Accounts or Podman and neither has the title translated when using cockpit-desktop. Adding cockpit.translate() actually fixes this behavior. Accounts and Podman also miss this call. However Terminal or Sosreport have this call but do NOT have translated titles. Update, Terminal works, I am using french to test this and the translation of Terminal is Terminal. When I updated the translation then it was used. Still looking what is the issue with sosreport as it has translation and is not equal. I have verified that a title 'Subscriptions' is displayed in translated version.
image attached.
subscription-manager-cockpit-4^11.g9a71113-1.el9_1.noarch
python3-subscription-manager-rhsm-1.29.30-1.el9.x86_64
rhsm-icons-4^11.g9a71113-1.el9_1.noarch
I have verified, that "Subscription" tab is translated to a set language. Adding attachment with more info. [root@localhost ~]# subscription-manager version 服务器类型:红帽订阅管理(Red Hat Subscription Management) 订阅管理服务器:4.2.12-1 订阅管理规则:5.43 subscription-manager: 1.29.32-1.el9 [root@localhost ~]# rpm -qa | grep cockpit cockpit-bridge-284-1.el9.x86_64 cockpit-system-284-1.el9.noarch subscription-manager-cockpit-5-1.el9.noarch cockpit-storaged-284-1.el9.noarch cockpit-packagekit-284-1.el9.noarch cockpit-ws-284-1.el9.x86_64 cockpit-284-1.el9.x86_64 cockpit-podman-62-1.el9.noarch 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 (subscription-manager-cockpit bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2023:2555 |