Fix(portal): Restore Missing i18n Translation Keys - #22722
Conversation
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Translates the wrongly removed i18n keys that were restored in the previous commit from English placeholders to their native languages: - de-de: German translations - es-es: Spanish translations - fr-fr: French translations - ko-kr: Korean translations - pt-br: Brazilian Portuguese translations - ru-ru: Russian translations - tr-tr: Turkish translations - zh-cn: Simplified Chinese translations - zh-tw: Traditional Chinese translations Ref: goharbor#22587 Signed-off-by: bupd <bupdprasanth@gmail.com>
Adds the i18n missing keys detection script to the UI_UT CI workflow. This ensures that PRs introducing translation key usage will fail CI if the corresponding keys are not defined in the language files. The check runs early in the pipeline to fail fast before lint and tests. Signed-off-by: bupd <bupdprasanth@gmail.com>
The script now checks two things: 1. Keys used in code exist in en-us-lang.json 2. All language files have the same keys as en-us This catches missing translations across all supported languages, not just the English source file. Signed-off-by: bupd <bupdprasanth@gmail.com>
|
Synced missing translation keys across de-de, es-es, fr-fr, ko-kr, pt-br, tr-tr, zh-cn, and zh-tw language files to match en-us-lang.json. All translations are in their native languages. ru-ru is excluded as it requires a separate effort (see issue goharbor#22721). Signed-off-by: bupd <bupdprasanth@gmail.com>
Updated find-missing-i18n.js to also detect single-word translation
keys like {{ 'CANCEL' | translate }} in addition to dotted keys like
{{ 'BUTTON.CANCEL' | translate }}.
Signed-off-by: bupd <bupdprasanth@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22722 +/- ##
===========================================
+ Coverage 45.36% 65.87% +20.50%
===========================================
Files 244 1074 +830
Lines 13333 116355 +103022
Branches 2719 2931 +212
===========================================
+ Hits 6049 76645 +70596
- Misses 6983 35467 +28484
- Partials 301 4243 +3942
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
@bupd thanks for the PR, please ensure all the pipelines are passed. |
- missing comma, - unescaped " " Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
|
@bupd please check the failure in the test. I tried re-running and it failed with same failures, so it doesn't seem to be caused by flakiness. |
The test is definitely flaky; if you rerun it, it will eventually work just fine. here is the problem |
|
fix for flaky test -> #22768 |
Summary
PR #22587 wrongly removed 9 translation keys that are still actively used in the UI. This PR restores them and adds a detection script to prevent future occurrences.
Changes
Restored translation keys:
PROJECT.CONNECTION_LIMITPROJECT.PROXY_CACHE_MAX_UPSTREAM_CONN_TIPPROJECT.PROXY_CACHE_MAX_UPSTREAM_CONN_INPUT_TIPPROJECT.NO_PROJECTPROJECT_CONFIG.AUTOSBOM_TOGGLEPROJECT_CONFIG.AUTOSBOM_POLICYPROJECT_CONFIG.CONTENT_TRUST_POLICYREPLICATION.REPLICATION_TRIGGERCONFIG.WEBHOOK_NOTIFICATION_ENABLEDAdded i18n detection script:
npm run i18n:check- scans HTML/TS files for translation keys and reports any missing from language filesVerify translation keys
cd src/portal && npm run i18n:check- should report no missing keysPlease indicate you've done the following: