Bug 1947367

Summary: Missing Compliance/SyspurposeCompliance translations
Product: [Community] Candlepin Reporter: Nikos Moumoulidis <nmoumoul>
Component: candlepinAssignee: candlepin-bugs
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: high    
Version: 3.2CC: candlepin-bugs, redakkan, sdhome, skallesh
Target Milestone: ---Keywords: Triaged
Target Release: 3.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: candlepin-3.1.29-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1947354 Environment:
Last Closed: 2021-06-23 09:10:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1947354, 1947368    
Bug Blocks:    

Description Nikos Moumoulidis 2021-04-08 10:14:05 UTC
+++ This bug was initially created as a clone of Bug #1947354 +++

Description of problem:
As described in comment 1663388#c10, there are missing translations from candlepin. More specifically:
1 "Not supported by a valid subscription."
2 "The requested usage preference "Test" is not provided by a currently consumed subscription."
3 "The requested add-on "test" is not provided by a currently consumed subscription."
4 "The service level preference "Unavailable" is not provided by a currently consumed subscription."

Version-Release number of selected component (if applicable):
- Probably most candlepin versions, but surely anything after 3.0
- A subman version available in RHEL 8.4, e.g. 1.28.3

How reproducible:
100%

Steps to Reproduce:
1. Add at least one installed product cert in your local machine
1. Set some syspurpose preference values locally (usage, role, addon, sla)
2. Run the status command with a language, e.g. "LANG=zh_CN.UTF-8 subscription-manager status" against Candlepin

Actual results:
+-------------------------------------------+
   系统状态详情
+-------------------------------------------+
总体状态:无效                    <================= TRANSLATED

Red Hat Enterprise Linux for Real Time:
- Not supported by a valid subscription.    <======= NOT TRANSLATED

Red Hat Enterprise Linux for x86_64:
- Not supported by a valid subscription.    <======= NOT TRANSLATED

系统目的状态:不匹配               <================= TRANSLATED
- The requested usage preference "Test" is not provided by a currently consumed subscription.      <======= NOT TRANSLATED
- The requested add-on "test" is not provided by a currently consumed subscription.                <======= NOT TRANSLATED
- The service level preference "Unavailable" is not provided by a currently consumed subscription. <======= NOT TRANSLATED

Expected results:
Expected all of the strings noted above to be translated

Additional info:

Notes for dev who will pick this up:
- The syspurpose related strings such as "The service level preference "whatever" is not provided by a currently consumed subscription" are not translated because we try to translate them at runtime (by using this method https://github.com/candlepin/candlepin/blob/419f9e66e0f970241c4106274e83859c365783be/server/src/main/java/org/candlepin/policy/SystemPurposeComplianceStatus.java#L268) but this won't work unless we have them marked as translated at compile time. Please see StatusReasonMessageGenerator.java as an example on how to do this.

- The "Not supported by a valid subscription." string is a different case. It seems to be marked as translatable, and it is extracted normally, but still does not get translated. We need more investigation here.