CONSOLE-5428: follow up la migration du i18next-cli - #16926
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@logonoff: This pull request references CONSOLE-5428 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe change centralizes console-extension translation extraction, updates frontend generation and validation commands, and corrects English localization keys, plural forms, interpolation variables, and translated labels. ChangesInternationalization updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/label px-approved |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@frontend/i18n-scripts/ConsoleExtensionsI18nextCliPlugin.ts`:
- Around line 65-71: Update the key parsing loop to reject any fullKey
containing anything other than exactly one `~` separator, rather than truncating
extra segments via split('~', 2). Preserve the existing warning path for invalid
values and add a regression test covering `%ns~key~suffix%` that verifies no key
is registered.
In `@INTERNATIONALIZATION.md`:
- Line 58: Update the extraction description in INTERNATIONALIZATION.md to
clearly distinguish runtime key resolution by i18next from static key extraction
by i18next-cli, explicitly stating that the CLI does not execute code and
therefore cannot resolve dynamic expressions into translation keys.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: fad072cb-b7ad-4fb6-a5df-3f27c3db2139
📒 Files selected for processing (22)
.gitignoreDockerfile.plugins.demoINTERNATIONALIZATION.mdclean-frontend.shdynamic-demo-plugin/i18next.config.tsfrontend/.prettierignorefrontend/__tests__/i18n-structure.spec.tsfrontend/i18n-scripts/ConsoleExtensionsI18nextCliPlugin.tsfrontend/i18n-scripts/__tests__/ConsoleExtensionsI18nextCliPlugin.spec.tsfrontend/i18next.config.tsfrontend/jest.config.tsfrontend/package.jsonfrontend/packages/console-app/locales/en/console-app.jsonfrontend/packages/console-app/src/components/data-view/ConsoleDataView.tsxfrontend/packages/console-app/src/components/quick-starts/utils/quick-start-context.tsxfrontend/packages/operator-lifecycle-manager/locales/en/olm.jsonfrontend/packages/topology/locales/en/topology.jsonfrontend/packages/topology/src/components/list-view/cells/MemoryCell.tsxfrontend/public/components/control-plane-machine-set.tsxfrontend/public/components/impersonate-notifier.tsxfrontend/public/locales/en/public.jsontest-frontend.sh
💤 Files with no reviewable changes (3)
- frontend/.prettierignore
- frontend/jest.config.ts
- clean-frontend.sh
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: logonoff, 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 |
avec autre cleanup work
|
@logonoff: all tests passed! 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. |
More follow up for #16864 / #16796 + other cleanup
Solution description:
yarn build-plugin-sdktoyarn generateto fix muscle memoryDid not reintroduce pluralization script because the defaults were kind of bad. It generated stuff like this:
which is objectively worse than not doing anything at all. However I added a test so that the plural string can never be the same as the singular one. For cases that genuinely should have plural===singular, change from
countto something else so those strings aren't created in the first place.Summary by CodeRabbit
Bug Fixes
Improvements