OCPBUGS-33836: quickstart page i18n misses (Fix Quick Starts i18n bundle lookup for zh-CN)#16819
OCPBUGS-33836: quickstart page i18n misses (Fix Quick Starts i18n bundle lookup for zh-CN)#16819cajieh wants to merge 1 commit into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@cajieh: This pull request references Jira Issue OCPBUGS-74310, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughQuick-start localization now derives language from ChangesResolved language and resource bundles
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/packages/console-app/src/components/quick-starts/utils/quick-start-context.tsx (1)
164-166: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression coverage for resolved-language bundle selection.
Cover
zh-CNinitialization, missingconsole-appbundles, and the corresponding language-change path so these two resource-loading implementations cannot drift.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/packages/console-app/src/components/quick-starts/utils/quick-start-context.tsx` around lines 164 - 166, Add regression tests around the resource-loading logic using i18n initialization with resolvedLanguage set to zh-CN, including behavior when the console-app bundle is missing. Also cover the language-change path and assert both paths select and process the resolved-language bundle consistently; keep the tests anchored to getProcessedResourceBundle and the surrounding initialization/language-change handlers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@frontend/packages/console-app/src/components/quick-starts/utils/quick-start-context.tsx`:
- Around line 164-166: Add regression tests around the resource-loading logic
using i18n initialization with resolvedLanguage set to zh-CN, including behavior
when the console-app bundle is missing. Also cover the language-change path and
assert both paths select and process the resolved-language bundle consistently;
keep the tests anchored to getProcessedResourceBundle and the surrounding
initialization/language-change handlers.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: d367294b-f70c-4139-a0db-bb0d00ebd7f5
📒 Files selected for processing (2)
frontend/packages/console-app/src/components/quick-starts/utils/quick-start-context.tsxfrontend/packages/console-app/src/components/user-preferences/language/useLanguage.ts
|
/jira refresh |
|
@cajieh: This pull request references Jira Issue OCPBUGS-74310, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@openshift-ci-robot: GitHub didn't allow me to request PR reviews from the following users: yanpzhan. Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/approve |
|
Scheduling tests matching the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cajieh, rhamilto The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@cajieh: This pull request references Jira Issue OCPBUGS-33836, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@cajieh: This pull request references Jira Issue OCPBUGS-33836, which is invalid:
Comment DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@cajieh: This pull request references Jira Issue OCPBUGS-33836, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (yapei@redhat.com), skipping review request. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/retest |
|
/test e2e-playwright |
|
@cajieh: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |


Analysis / Root cause:
Quick Starts chrome strings (for example "Filter by keyword...", "Status") are not translated via
t(). Console loads the fullconsole-appresource bundle and passes it to PatternFly Quick Starts withi18n.getResourceBundle(language, 'console-app').Language preference stores Chinese as
zh-CN, but Console i18n is configured withload: 'languageOnly', so locale files are stored underzh. Looking up the bundle withzh-CNreturnedundefined, and PatternFly fell back to English. The rest of Console was unaffected because it usest(), which resolveszh-CN→zhcorrectly.Related history: OCPBUGS-29365 / #13612 changed the preference value from
zhtozh-CN, which exposed this Quick Starts lookup mismatch.Solution description:
Use i18next's
resolvedLanguagewhen loading the Quick Startsconsole-appresource bundle, with'en'as a fallback:quick-start-context.tsx— initial context values passed to PatternFlyuseLanguage.ts—languageChangedhandler that updates the bundle viasetResourceBundleresolvedLanguageis the language i18next actually resolved/loaded (for examplezhwhen preference iszh-CN), which matches where resources are stored underload: 'languageOnly'. See https://www.i18next.com/overview/api#resolvedlanguage.Also guard
getResourceBundlewith?? {}so a missing bundle does not passundefinedinto processing / PatternFly.This does not change language preference storage, locale JSON files, or dynamic plugin i18n (plugins use their own
plugin__*namespaces andt()).Screenshots / screen recording:

Before:
After

Test setup:
zh-CN)./quickstart).Test cases:
t()are unchanged.Browser conformance:
Additional info:
itemskey issues are out of scope for this PR.Reviewers and assignees: