Bug 2071761

Summary: Translation Keys Are Not Namespaced
Product: OpenShift Container Platform Reporter: Andrew Ballantyne <aballant>
Component: Management ConsoleAssignee: Cyril <cajieh>
Status: CLOSED ERRATA QA Contact: Xiyun Zhao <xiyuzhao>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.11CC: aos-bugs, yapei
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 11:03:18 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:
Bug Depends On:    
Bug Blocks: 2063756    

Description Andrew Ballantyne 2022-04-04 18:08:54 UTC
Description of problem:
During the bug fix of 2063756 we implemented a bug around the translated keys. They lack runtime values that namespace the key, so it assumes public namespace and thus cannot find the translation.

Steps to Reproduce:
1. Go to UserPreferences (user in the top right, user preferences)
2. See the error in the console / reproducible when you change languages 

Actual results:
The extension "console.user-preference/item" that is contributed from DevConsole does not properly link to the right translation json and thus error out in the console (and not translate properly when we have full translations).

Expected results:
For the values that are translated to have proper `devconsole~` namespace in front of the translation value


Additional info:

Quick and dirty fix that will need to be properly tested:

```
diff --git a/frontend/packages/dev-console/src/components/import/import-types.ts b/frontend/packages/dev-console/src/components/import/import-types.ts
index 0c1c5c77c4..4207b5bde6 100644
--- a/frontend/packages/dev-console/src/components/import/import-types.ts
+++ b/frontend/packages/dev-console/src/components/import/import-types.ts
@@ -305,27 +305,27 @@ export interface ImportData {

 export enum TerminationTypes {
   // t('devconsole~Edge')
-  edge = 'Edge',
+  edge = 'devconsole~Edge',
   // t('devconsole~Passthrough')
-  passthrough = 'Passthrough',
+  passthrough = 'devconsole~Passthrough',
   // t('devconsole~Re-encrypt')
-  reencrypt = 'Re-encrypt',
+  reencrypt = 'devconsole~Re-encrypt',
 }

 export enum InsecureTrafficTypes {
   // t('devconsole~None')
-  None = 'None',
+  None = 'devconsole~None',
   // t('devconsole~Allow')
-  Allow = 'Allow',
+  Allow = 'devconsole~Allow',
   // t('devconsole~Redirect')
-  Redirect = 'Redirect',
+  Redirect = 'devconsole~Redirect',
 }

 export enum PassthroughInsecureTrafficTypes {
   // t('devconsole~None')
-  None = 'None',
+  None = 'devconsole~None',
   // t('devconsole~Redirect')
-  Redirect = 'Redirect',
+  Redirect = 'devconsole~Redirect',
 }

 export interface AutoscaleWindowType {
```

Comment 3 Xiyun Zhao 2022-04-21 07:26:03 UTC
This issu has been verified on payload 4.11.0-0.nightly-2022-04-16-163450

Verification Step:
1. Login OCP, change to developer perspective 
2. Go to UserPreferences page by clicking the user in the top right
3. Change languages by using the Language dropdown list
4. Tracking the issue on the console of browser
5. Track this issue on different browser, espicially using 'Edge'

Reulut:
4,5. The error message of 'Missing i18n key "Edge" in namespace "public and language" en' is gone, issue is being fixed on Edge, and did not show up on Chrome, Fixfox. Page can be translate as normal after change the language on User preference page

Comment 5 errata-xmlrpc 2022-08-10 11:03:18 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 (Important: OpenShift Container Platform 4.11.0 bug fix and security 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/RHSA-2022:5069