Skip to content

chore(e2e): localization cleanup - #4673

Merged
openshift-merge-bot[bot] merged 14 commits into
redhat-developer:mainfrom
teknaS47:translation-cleanup
Apr 24, 2026
Merged

chore(e2e): localization cleanup#4673
openshift-merge-bot[bot] merged 14 commits into
redhat-developer:mainfrom
teknaS47:translation-cleanup

Conversation

@teknaS47

@teknaS47 teknaS47 commented Apr 22, 2026

Copy link
Copy Markdown
Member

Description

Cleaning up localization files to use existing json files
Skipping failing test due to bug RHDHBUGS-2958

Which issue(s) does this PR fix

PR acceptance criteria

Please make sure that the following steps are complete:

  • GitHub Actions are completed and successful
  • Unit Tests are updated and passing
  • E2E Tests are updated and passing
  • Documentation is updated if necessary (requirement for new features)
  • Add a screenshot if the change is UX/UI related

How to test changes / Special notes to the reviewer

@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Apr 22, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (2)

Grey Divider


Action required

1. Quickstart open not localized 🐞 Bug ≡ Correctness
Description
UIhelper.openQuickstartIfHidden() still locates the Quick Start toggle button by the English
accessible name "Hide", even though this PR introduced a locale-specific label map for the same
control. In non-English locale runs, this locator will never match, causing the method to mis-detect
Quick Start state and then fail waiting for the button to be visible.
Code

e2e-tests/playwright/utils/ui-helper.ts[R899-902]

  async openQuickstartIfHidden(): Promise<void> {
    const quickstartHideButton = this.page.getByRole("button", {
-      name: t["plugin.quickstart"][lang]["footer.hide"],
+      name: "Hide",
    });
Relevance

⭐⭐⭐ High

Factually inconsistent: PR added locale-aware quickstart label helper but openQuickstartIfHidden
still hardcodes "Hide".

PR-#4436
PR-#4519
PR-#4526

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
This PR adds a locale-aware lookup for the Quick Start hide button and uses it in
hideQuickstartIfVisible(), but openQuickstartIfHidden() continues to use a hard-coded English
name. The Playwright config supports non-English locales via process.env.LOCALE, so this
inconsistency will surface when running those projects/scripts.

e2e-tests/playwright/utils/ui-helper.ts[871-912]
e2e-tests/playwright.config.ts[19-42]
e2e-tests/playwright.config.ts[69-71]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`openQuickstartIfHidden()` hard-codes the button name "Hide". This breaks under non-English locales because the Quick Start hide button label is localized (and this PR already introduced a locale map used elsewhere).

### Issue Context
`hideQuickstartIfVisible()` now uses `getQuickstartHideButton()` which picks the proper label based on `LOCALE`, but `openQuickstartIfHidden()` still uses `getByRole(..., { name: "Hide" })`.

### Fix Focus Areas
- e2e-tests/playwright/utils/ui-helper.ts[871-912]
- e2e-tests/playwright/utils/ui-helper.ts[899-912]

### Suggested change
In `openQuickstartIfHidden()`, replace the hard-coded locator with `const quickstartHideButton = this.getQuickstartHideButton();` and keep subsequent visibility checks/assertions using that locator.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Advisory comments

2. locale.ts imports JSON translations 📎 Requirement gap ⚙ Maintainability
Description
The e2e localization helper still imports translation content from .json files (via `with { type:
"json" }`) instead of TypeScript sources. This violates the requirement to switch e2e translation
imports to .ts and can break/lag behind the intended translation cleanup approach.
Code

e2e-tests/playwright/e2e/localization/locale.ts[R1-16]

import deBackstage from "../../../../translations/backstage-de.json" with { type: "json" };
-import deCommunityPluginsBase from "../../../../translations/community-plugins-de.json" with { type: "json" };
-import deRhdh from "../../../../translations/test/rhdh-de.json" with { type: "json" };
-import deCommunityPlugins from "../../../../translations/test/community-plugins-de.json" with { type: "json" };
-import deRhdhPlugins from "../../../../translations/test/rhdh-plugins-de.json" with { type: "json" };
+import deRhdh from "../../../../translations/rhdh-de.json" with { type: "json" };

import esBackstage from "../../../../translations/backstage-es.json" with { type: "json" };
-import esCommunityPluginsBase from "../../../../translations/community-plugins-es.json" with { type: "json" };
-import esRhdh from "../../../../translations/test/rhdh-es.json" with { type: "json" };
-import esCommunityPlugins from "../../../../translations/test/community-plugins-es.json" with { type: "json" };
-import esRhdhPlugins from "../../../../translations/test/rhdh-plugins-es.json" with { type: "json" };
+import esRhdh from "../../../../translations/rhdh-es.json" with { type: "json" };

import frBackstage from "../../../../translations/backstage-fr.json" with { type: "json" };
-import frCommunityPluginsBase from "../../../../translations/community-plugins-fr.json" with { type: "json" };
-import frRhdh from "../../../../translations/test/rhdh-fr.json" with { type: "json" };
-import frCommunityPlugins from "../../../../translations/test/community-plugins-fr.json" with { type: "json" };
-import frRhdhPlugins from "../../../../translations/test/rhdh-plugins-fr.json" with { type: "json" };
+import frRhdh from "../../../../translations/rhdh-fr.json" with { type: "json" };

import itBackstage from "../../../../translations/backstage-it.json" with { type: "json" };
-import itCommunityPluginsBase from "../../../../translations/community-plugins-it.json" with { type: "json" };
-import itRhdh from "../../../../translations/test/rhdh-it.json" with { type: "json" };
-import itCommunityPlugins from "../../../../translations/test/community-plugins-it.json" with { type: "json" };
-import itRhdhPlugins from "../../../../translations/test/rhdh-plugins-it.json" with { type: "json" };
+import itRhdh from "../../../../translations/rhdh-it.json" with { type: "json" };

import jaBackstage from "../../../../translations/backstage-ja.json" with { type: "json" };
-import jaCommunityPluginsBase from "../../../../translations/community-plugins-ja.json" with { type: "json" };
-import jaRhdh from "../../../../translations/test/rhdh-ja.json" with { type: "json" };
-import jaCommunityPlugins from "../../../../translations/test/community-plugins-ja.json" with { type: "json" };
-import jaRhdhPlugins from "../../../../translations/test/rhdh-plugins-ja.json" with { type: "json" };
+import jaRhdh from "../../../../translations/rhdh-ja.json" with { type: "json" };

-import en from "../../../../translations/test/all-v1.8_s3281-en.json" with { type: "json" };
+import en from "../../../../translations/test/all-en.json" with { type: "json" };
Relevance

⭐ Low

Repo’s e2e localization helper historically imports JSON bundles; no evidence team is migrating to
TS sources.

PR-#4519
PR-#3555
PR-#3935

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 4 requires e2e tests to use TypeScript translation sources rather than importing
translation JSON directly. e2e-tests/playwright/e2e/localization/locale.ts imports multiple
translation JSON files using with { type: "json" }, meaning the e2e suite still depends on JSON
imports.

Update translation imports in e2e tests to use TypeScript files instead of JSON references
e2e-tests/playwright/e2e/localization/locale.ts[1-16]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`e2e-tests/playwright/e2e/localization/locale.ts` still imports translation `.json` files using JSON import assertions. Compliance requires e2e translation imports to use TypeScript sources instead of JSON references.

## Issue Context
The repo already contains TypeScript translation modules under `packages/app/src/translations/...` (e.g., `packages/app/src/translations/rhdh/*.ts`). The e2e locale helper should import from TS (or from a TS wrapper that exports the translation objects) rather than importing JSON files directly.

## Fix Focus Areas
- e2e-tests/playwright/e2e/localization/locale.ts[1-16]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. rhdh-de.json missing timestamp 📎 Requirement gap ⚙ Maintainability
Description
Translation JSON filenames referenced by the e2e suite (e.g., translations/rhdh-de.json,
translations/rhdh-es.json) do not follow the required <repo_name>-<timestamp>-<locale>.json
naming convention. Keeping these legacy filenames breaks the standardization required for
localization maintenance/automation.
Code

e2e-tests/playwright/e2e/localization/locale.ts[R2-14]

+import deRhdh from "../../../../translations/rhdh-de.json" with { type: "json" };

import esBackstage from "../../../../translations/backstage-es.json" with { type: "json" };
-import esCommunityPluginsBase from "../../../../translations/community-plugins-es.json" with { type: "json" };
-import esRhdh from "../../../../translations/test/rhdh-es.json" with { type: "json" };
-import esCommunityPlugins from "../../../../translations/test/community-plugins-es.json" with { type: "json" };
-import esRhdhPlugins from "../../../../translations/test/rhdh-plugins-es.json" with { type: "json" };
+import esRhdh from "../../../../translations/rhdh-es.json" with { type: "json" };

import frBackstage from "../../../../translations/backstage-fr.json" with { type: "json" };
-import frCommunityPluginsBase from "../../../../translations/community-plugins-fr.json" with { type: "json" };
-import frRhdh from "../../../../translations/test/rhdh-fr.json" with { type: "json" };
-import frCommunityPlugins from "../../../../translations/test/community-plugins-fr.json" with { type: "json" };
-import frRhdhPlugins from "../../../../translations/test/rhdh-plugins-fr.json" with { type: "json" };
+import frRhdh from "../../../../translations/rhdh-fr.json" with { type: "json" };

import itBackstage from "../../../../translations/backstage-it.json" with { type: "json" };
-import itCommunityPluginsBase from "../../../../translations/community-plugins-it.json" with { type: "json" };
-import itRhdh from "../../../../translations/test/rhdh-it.json" with { type: "json" };
-import itCommunityPlugins from "../../../../translations/test/community-plugins-it.json" with { type: "json" };
-import itRhdhPlugins from "../../../../translations/test/rhdh-plugins-it.json" with { type: "json" };
+import itRhdh from "../../../../translations/rhdh-it.json" with { type: "json" };

import jaBackstage from "../../../../translations/backstage-ja.json" with { type: "json" };
-import jaCommunityPluginsBase from "../../../../translations/community-plugins-ja.json" with { type: "json" };
-import jaRhdh from "../../../../translations/test/rhdh-ja.json" with { type: "json" };
-import jaCommunityPlugins from "../../../../translations/test/community-plugins-ja.json" with { type: "json" };
-import jaRhdhPlugins from "../../../../translations/test/rhdh-plugins-ja.json" with { type: "json" };
+import jaRhdh from "../../../../translations/rhdh-ja.json" with { type: "json" };
Relevance

⭐ Low

Repo translation files commonly use legacy names (e.g., backstage-de.json, rhdh-de.json); timestamp
naming not enforced.

PR-#4319
PR-#4051
PR-#4165

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2 requires translation JSON filenames to follow
<repo_name>-<timestamp>-<locale>.json. The updated imports in locale.ts still reference legacy
names like rhdh-de.json, rhdh-es.json, etc., which omit the timestamp segment and therefore do
not match the required convention.

Rename translation JSON files to <repo_name>-<timestamp>-<locale>.json format
e2e-tests/playwright/e2e/localization/locale.ts[2-14]
translations/rhdh-de.json[1-12]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Translation JSON files in use (e.g., `translations/rhdh-de.json`) do not follow the required `<repo_name>-<timestamp>-<locale>.json` naming format.

## Issue Context
The e2e localization helper imports these files directly, so renaming requires updating the import paths accordingly.

## Fix Focus Areas
- e2e-tests/playwright/e2e/localization/locale.ts[2-16]
- translations/rhdh-de.json[1-12]
- translations/rhdh-es.json[1-12]
- translations/rhdh-fr.json[1-12]
- translations/rhdh-it.json[1-12]
- translations/rhdh-ja.json[1-12]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@teknaS47

Copy link
Copy Markdown
Member Author

/test e2e-ocp-nightly

@github-actions

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@teknaS47

Copy link
Copy Markdown
Member Author

/test e2e-ocp-helm-nightly

@rhdh-qodo-merge

Copy link
Copy Markdown

Review Summary by Qodo

Localization cleanup: simplify e2e tests and consolidate translation files

✨ Enhancement 🧪 Tests

Grey Divider

Walkthroughs

Description
• Replace localization lookups with hardcoded English strings in e2e tests
• Simplify locale.ts by removing duplicate translation file imports
• Update German and Spanish translations for selfService menu item
• Improve quickstart hide button handling with locale-aware labels
Diagram
flowchart LR
  A["E2E Test Files"] -->|Remove i18n lookups| B["Hardcoded English Strings"]
  C["locale.ts"] -->|Remove duplicate imports| D["Simplified Locale Config"]
  E["Translation Files"] -->|Update menu items| F["German & Spanish Translations"]
  G["UIhelper"] -->|Add locale map| H["Quickstart Hide Button"]
Loading

Grey Divider

File Changes

1. e2e-tests/playwright/e2e/extensions.spec.ts 🧪 Tests +115/-147

Replace i18n lookups with hardcoded English strings

e2e-tests/playwright/e2e/extensions.spec.ts


2. e2e-tests/playwright/e2e/default-global-header.spec.ts 🧪 Tests +13/-13

Replace i18n lookups with hardcoded English strings

e2e-tests/playwright/e2e/default-global-header.spec.ts


3. e2e-tests/playwright/e2e/localization/locale.ts ✨ Enhancement +7/-37

Remove duplicate translation file imports and simplify

e2e-tests/playwright/e2e/localization/locale.ts


View more (23)
4. e2e-tests/playwright/support/pages/extensions.ts 🧪 Tests +19/-26

Remove i18n dependencies and use hardcoded English strings

e2e-tests/playwright/support/pages/extensions.ts


5. e2e-tests/playwright/utils/ui-helper.ts ✨ Enhancement +20/-7

Add locale-aware quickstart hide button handling

e2e-tests/playwright/utils/ui-helper.ts


6. e2e-tests/playwright/e2e/catalog-timestamp.spec.ts 🐞 Bug fix +1/-1

Add enabled state check for clear button

e2e-tests/playwright/e2e/catalog-timestamp.spec.ts


7. e2e-tests/playwright/support/pages/home-page-customization.ts ✨ Enhancement +1/-4

Use UIhelper method for quickstart hiding

e2e-tests/playwright/support/pages/home-page-customization.ts


8. translations/rhdh-es.json 📝 Documentation +1/-1

Update Spanish selfService menu item translation

translations/rhdh-es.json


9. translations/rhdh-de.json 📝 Documentation +1/-1

Update German selfService menu item translation

translations/rhdh-de.json


10. e2e-tests/playwright.config.ts Additional files +0/-10

...

e2e-tests/playwright.config.ts


11. translations/test/all-en.json Additional files +0/-0

...

translations/test/all-en.json


12. translations/test/community-plugins-de.json Additional files +0/-451

...

translations/test/community-plugins-de.json


13. translations/test/community-plugins-es.json Additional files +0/-451

...

translations/test/community-plugins-es.json


14. translations/test/community-plugins-fr.json Additional files +0/-516

...

translations/test/community-plugins-fr.json


15. translations/test/community-plugins-it.json Additional files +0/-515

...

translations/test/community-plugins-it.json


16. translations/test/community-plugins-ja.json Additional files +0/-515

...

translations/test/community-plugins-ja.json


17. translations/test/rhdh-de.json Additional files +0/-91

...

translations/test/rhdh-de.json


18. translations/test/rhdh-es.json Additional files +0/-91

...

translations/test/rhdh-es.json


19. translations/test/rhdh-fr.json Additional files +0/-93

...

translations/test/rhdh-fr.json


20. translations/test/rhdh-it.json Additional files +0/-91

...

translations/test/rhdh-it.json


21. translations/test/rhdh-ja.json Additional files +0/-91

...

translations/test/rhdh-ja.json


22. translations/test/rhdh-plugins-de.json Additional files +0/-1092

...

translations/test/rhdh-plugins-de.json


23. translations/test/rhdh-plugins-es.json Additional files +0/-1092

...

translations/test/rhdh-plugins-es.json


24. translations/test/rhdh-plugins-fr.json Additional files +0/-1019

...

translations/test/rhdh-plugins-fr.json


25. translations/test/rhdh-plugins-it.json Additional files +0/-1014

...

translations/test/rhdh-plugins-it.json


26. translations/test/rhdh-plugins-ja.json Additional files +0/-1014

...

translations/test/rhdh-plugins-ja.json


Grey Divider

Qodo Logo

@teknaS47
teknaS47 force-pushed the translation-cleanup branch from d750690 to d70a98b Compare April 22, 2026 03:41
@teknaS47

Copy link
Copy Markdown
Member Author

/test e2e-ocp-helm-nightly

@github-actions

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@teknaS47

Copy link
Copy Markdown
Member Author

/test e2e-ocp-helm-nightly

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

Comment thread translations/rhdh-de.json
@teknaS47

Copy link
Copy Markdown
Member Author

/test e2e-ocp-helm-nightly

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@teknaS47
teknaS47 force-pushed the translation-cleanup branch from a75aebb to 81fe8f4 Compare April 23, 2026 04:37
@github-actions

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@teknaS47

Copy link
Copy Markdown
Member Author

/test e2e-ocp-helm-nightly

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@teknaS47
teknaS47 force-pushed the translation-cleanup branch from 81fe8f4 to 6bda64c Compare April 23, 2026 08:38
@openshift-ci openshift-ci Bot added the lgtm label Apr 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

Comment thread e2e-tests/playwright/e2e/plugins/bulk-import.spec.ts
@openshift-ci openshift-ci Bot removed the lgtm label Apr 24, 2026
@openshift-ci openshift-ci Bot added the lgtm label Apr 24, 2026
@teknaS47
teknaS47 force-pushed the translation-cleanup branch from 54d35f4 to 88fd8ad Compare April 24, 2026 11:50
@openshift-ci openshift-ci Bot removed the lgtm label Apr 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

Co-authored-by: Zbyněk Drápela <61500440+zdrapela@users.noreply.github.com>
@teknaS47
teknaS47 force-pushed the translation-cleanup branch from 88fd8ad to 9574b2a Compare April 24, 2026 11:51
@github-actions

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@openshift-ci openshift-ci Bot added the lgtm label Apr 24, 2026
@openshift-ci openshift-ci Bot removed the lgtm label Apr 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@zdrapela

Copy link
Copy Markdown
Member

/retest

@zdrapela

Copy link
Copy Markdown
Member

/test e2e-ocp-helm-nightly

@openshift-ci

openshift-ci Bot commented Apr 24, 2026

Copy link
Copy Markdown

@teknaS47: The following test 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/e2e-ocp-helm-nightly 61a6b31 link false /test e2e-ocp-helm-nightly

Full PR test history. Your PR dashboard.

Details

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.

@teknaS47

Copy link
Copy Markdown
Member Author

/test e2e-ocp-helm-nightly

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@zdrapela

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Apr 24, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit fa4ddb1 into redhat-developer:main Apr 24, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants