Bug 2071761 - Translation Keys Are Not Namespaced
Summary: Translation Keys Are Not Namespaced
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.11
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.11.0
Assignee: Cyril
QA Contact: Xiyun Zhao
Depends On:
Blocks: 2063756
TreeView+ depends on / blocked
Reported: 2022-04-04 18:08 UTC by Andrew Ballantyne
Modified: 2022-08-10 11:03 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2022-08-10 11:03:18 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github openshift console pull 11284 0 None open Bug 2071761: - Translation Keys Are Not Namespaced 2022-04-05 11:55:48 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:03:46 UTC

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'

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.


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