console icon indicating copy to clipboard operation
console copied to clipboard

CONSOLE-4778: Bump i18next and react-i18next to the reasonably recent version

Open krishagarwal278 opened this issue 3 months ago • 18 comments

Updating i18next and react-i18next to reasonably stable version.

i18next: 23.16.x

react-i18next: 15.1.x

Verified the changes on dynamic plugins for breaking changes: None found on Dynamic Demo plugin, CronTab plugin, KubeVirt plugin

krishagarwal278 avatar Sep 16 '25 17:09 krishagarwal278

@krishagarwal278: This pull request references CONSOLE-4778 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 "4.21.0" version, but no target version was set.

In response to this:

Updating i18next and react-i18next to reasonably stable version.

i18next: 23.16.x

react-i18next: 15.1.x

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 avatar Sep 16 '25 17:09 openshift-ci-robot

/retest

krishagarwal278 avatar Sep 17 '25 00:09 krishagarwal278

/label docs-approved /label px-approved

krishagarwal278 avatar Sep 17 '25 14:09 krishagarwal278

/label px-approved /label docs-approved

logonoff avatar Sep 17 '25 14:09 logonoff

qe-approval / verified label: /assign @yapei @yanpzhan

krishagarwal278 avatar Sep 17 '25 17:09 krishagarwal278

@krishagarwal278: This pull request references CONSOLE-4778 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 "4.21.0" version, but no target version was set.

In response to this:

Updating i18next and react-i18next to reasonably stable version.

i18next: 23.16.x

react-i18next: 15.1.x

Verified the changes on dynamic plugins for breaking changes: None found on Dynamic Demo Plugin, CronTab plugin, KubeVirt plugin

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 avatar Sep 18 '25 19:09 openshift-ci-robot

@krishagarwal278: This pull request references CONSOLE-4778 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 "4.21.0" version, but no target version was set.

In response to this:

Updating i18next and react-i18next to reasonably stable version.

i18next: 23.16.x

react-i18next: 15.1.x

Verified the changes on dynamic plugins for breaking changes: None found on Dynamic Demo plugin, CronTab plugin, KubeVirt plugin

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 avatar Sep 18 '25 19:09 openshift-ci-robot

/label tide/merge-method-squash

krishagarwal278 avatar Sep 18 '25 19:09 krishagarwal278

/retest

krishagarwal278 avatar Sep 18 '25 23:09 krishagarwal278

Checked on cluster launched against the pr. There is not regression issue. /label qe-approved /verified by @yanpzhan

yanpzhan avatar Sep 19 '25 11:09 yanpzhan

@krishagarwal278: This pull request references CONSOLE-4778 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 "4.21.0" version, but no target version was set.

In response to this:

Updating i18next and react-i18next to reasonably stable version.

i18next: 23.16.x

react-i18next: 15.1.x

Verified the changes on dynamic plugins for breaking changes: None found on Dynamic Demo plugin, CronTab plugin, KubeVirt plugin

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 avatar Sep 19 '25 11:09 openshift-ci-robot

@yanpzhan: This PR has been marked as verified by @yanpzhan.

In response to this:

Checked on cluster launched against the pr. There is not regression issue. /label qe-approved /verified by @yanpzhan

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 avatar Sep 19 '25 11:09 openshift-ci-robot

Walkthrough

Dependency bumps for i18next/react-i18next and i18next-parser; TFunction type imports moved from react-i18next to i18next; many translation returns changed from plain strings to React nodes; getVSphereHealth parameter order changed; assorted typing and small JSX adjustments across UI and tests.

Changes

Cohort / File(s) Change Summary
Dependency updates
dynamic-demo-plugin/package.json, frontend/package.json
Bumped i18next and react-i18next; dynamic-demo-plugin also updated i18next-parser to ^9.3.0.
TFunction import/source migration & test typing casts
frontend/packages/metal3-plugin/src/validations/validations.tsx, frontend/packages/topology/src/__tests__/TopologyShortcuts.spec.tsx, frontend/packages/vsphere-plugin/src/components/persist.ts, frontend/packages/vsphere-plugin/src/components/utils.ts, frontend/packages/console-plugin-sdk/src/utils/__tests__/extension-i18n.spec.ts, frontend/packages/dev-console/src/components/import/__tests__/import-submit-utils.spec.ts, frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts
Switched TFunction type imports from 'react-i18next' to 'i18next'; tests adjusted with casts or removed explicit TFunction annotations.
Translation return wrapping (string → ReactNode)
dynamic-demo-plugin/src/components/CustomOverviewDetailItem.tsx, frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx, frontend/public/components/about-modal.tsx, frontend/public/components/error.tsx, frontend/public/components/monitoring/receiver-forms/alert-manager-receiver-forms.tsx, frontend/public/components/pod.tsx, frontend/packages/console-app/src/components/nodes/NodesPage.tsx, frontend/public/components/cron-job.tsx, frontend/public/components/modals/column-management-modal.tsx, frontend/public/components/monitoring/receiver-forms/alert-manager-receiver-forms.tsx, frontend/public/components/error.tsx
Replaced plain-string translation returns with JSX fragments (e.g., <>{t('...')}</>) so translated values are React nodes.
Operator CSV status type assertions
frontend/packages/operator-lifecycle-manager/src/status/csv-status.ts
Added casts of i18n.t(...) results to ClusterServiceVersionStatus in multiple branches.
VSphere plugin parameter reorder & callsite updates
frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts, frontend/packages/vsphere-plugin/src/components/ClusterOverview/VSphereStatus.tsx
Changed getVSphereHealth signature from (t, responses, k8sResult) to (responses, k8sResult, t?); updated call sites to new ordering.
i18n usage / translation callback refactor
frontend/public/module/k8s/get-resources.ts
Removed local TFunction wrapper; now imports default i18next and passes i18next.t to translateExtension; integrated i18n loading flag.
useTranslationExt & validation typing changes
frontend/packages/console-plugin-sdk/src/utils/useTranslationExt.ts, frontend/packages/console-shared/src/utils/yup-validations.ts
Removed explicit TFunction usage; tightened useTranslationExt options to UseTranslationOptions<string>; nameValidationSchema no longer types t as TFunction.
Component typing changes (React.FC → React.FCC)
frontend/public/components/custom-resource-definition.tsx
Multiple components changed from React.FC to React.FCC; added CustomResourceDefinitionsPageProps alias and minor JSX wrapping in table cells.
Minor runtime-safe adjustments & locale edits
frontend/public/components/modals/configure-count-modal.tsx, frontend/public/components/about-modal.tsx, frontend/public/locales/en/public.json
Coerced a t(...) result to String(...) in one place; wrapped some translations in fragments; removed trailing periods from two locale keys/values.
Misc — UI small JSX updates
frontend/packages/console-app/src/components/nodes/NodesPage.tsx, frontend/public/components/pod.tsx, frontend/public/components/cron-job.tsx, frontend/public/components/modals/column-management-modal.tsx
Small JSX changes to return React nodes (fragments) for translated content in various UI components.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Verify all VSphere getVSphereHealth call sites updated and that optional t is provided where needed.
  • Confirm ClusterServiceVersionStatus casts match runtime values and do not mask mismatches.
  • Review React.FCC typing changes in custom-resource-definition.tsx for downstream compatibility.
  • Ensure replacing local translation wrapper with i18next.t in get-resources.ts preserves translation behavior and respects loading state.
✨ Finishing touches
  • [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Dec 08 '25 07:12 coderabbitai[bot]

/retest

jhadvig avatar Dec 16 '25 10:12 jhadvig

/retest

krishagarwal278 avatar Dec 17 '25 11:12 krishagarwal278

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: krishagarwal278

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Dec 22 '25 09:12 openshift-ci[bot]

@krishagarwal278: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-ovn cb45dcf8a79dcab7585ae2af0a3f3e8520e0f307 link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-gcp-console 18305fd1c440c32e466fd32c684639878d516589 link true /test e2e-gcp-console
ci/prow/frontend 18305fd1c440c32e466fd32c684639878d516589 link true /test frontend
ci/prow/okd-scos-images 9ac9e36e6bca30bd2b7f84752cc588f4cb842b44 link true /test okd-scos-images

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

openshift-ci[bot] avatar Dec 22 '25 09:12 openshift-ci[bot]