Skip to content

Fix(portal): Restore Missing i18n Translation Keys - #22722

Merged
wy65701436 merged 15 commits into
goharbor:mainfrom
bupd:fix-missing-i18n
Jan 22, 2026
Merged

Fix(portal): Restore Missing i18n Translation Keys#22722
wy65701436 merged 15 commits into
goharbor:mainfrom
bupd:fix-missing-i18n

Conversation

@bupd

@bupd bupd commented Jan 9, 2026

Copy link
Copy Markdown
Member

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_LIMIT
  • PROJECT.PROXY_CACHE_MAX_UPSTREAM_CONN_TIP
  • PROJECT.PROXY_CACHE_MAX_UPSTREAM_CONN_INPUT_TIP
  • PROJECT.NO_PROJECT
  • PROJECT_CONFIG.AUTOSBOM_TOGGLE
  • PROJECT_CONFIG.AUTOSBOM_POLICY
  • PROJECT_CONFIG.CONTENT_TRUST_POLICY
  • REPLICATION.REPLICATION_TRIGGER
  • CONFIG.WEBHOOK_NOTIFICATION_ENABLED

Added i18n detection script:

  • npm run i18n:check - scans HTML/TS files for translation keys and reports any missing from language files

Verify translation keys

  1. Run cd src/portal && npm run i18n:check - should report no missing keys
  2. Start frontend and verify:
    • Projects > New Project > Enable Proxy Cache: labels and tooltips display correctly
    • Project Config > SBOM: toggle and policy text display correctly
    • Replication Rules: "Trigger" column header displays correctly

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/update"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

bupd added 5 commits January 10, 2026 00:27
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>
@bupd
bupd requested a review from a team as a code owner January 9, 2026 19:25
@bupd

bupd commented Jan 9, 2026

Copy link
Copy Markdown
Member Author

bupd added 2 commits January 10, 2026 01:02
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

codecov Bot commented Jan 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.87%. Comparing base (c8c11b4) to head (441f218).
⚠️ Report is 632 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
unittests 65.87% <ø> (+20.50%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 989 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wy65701436 wy65701436 added the release-note/update Update or Fix label Jan 10, 2026
@wy65701436

Copy link
Copy Markdown
Contributor

@bupd thanks for the PR, please ensure all the pipelines are passed.

@wy65701436 wy65701436 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgm

@stonezdj
stonezdj self-requested a review January 12, 2026 08:55
bupd added 3 commits January 22, 2026 01:34
- missing comma,
- unescaped " "

Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
@reasonerjt
reasonerjt enabled auto-merge (squash) January 22, 2026 05:49
@reasonerjt
reasonerjt self-requested a review January 22, 2026 06:30
@reasonerjt reasonerjt assigned reasonerjt and unassigned stonezdj and chlins Jan 22, 2026
@reasonerjt
reasonerjt disabled auto-merge January 22, 2026 07:34
@reasonerjt

Copy link
Copy Markdown
Contributor

@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.

@wy65701436
wy65701436 enabled auto-merge (squash) January 22, 2026 07:37
@wy65701436
wy65701436 disabled auto-merge January 22, 2026 08:08
@wy65701436
wy65701436 enabled auto-merge (squash) January 22, 2026 08:09
@Vad1mo

Vad1mo commented Jan 22, 2026

Copy link
Copy Markdown
Member

@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

diff --git forkSrcPrefix/src/jobservice/worker/cworker/c_worker.go forkDstPrefix/src/jobservice/worker/cworker/c_worker.go
index b87071a6c73e8b02737a4afae7e0b7b34db5d083..d1a95c68dc39a23f7e63c37ceb80a6152850d714 100644
--- forkSrcPrefix/src/jobservice/worker/cworker/c_worker.go
+++ forkDstPrefix/src/jobservice/worker/cworker/c_worker.go
@@ -134,7 +134,16 @@ func (w *basicWorker) Start() error {
 	// Start the periodic scheduler
 	w.scheduler.Start()
 
+	// Start the backend worker pool
+	// Add middleware
+	w.pool.Middleware((*workerContext).logJob)
+	// Non blocking call
+	w.pool.Start()
+	logger.Infof("Basic worker is started")
+
 	// Listen to the system signal
+	// IMPORTANT: This goroutine must be started AFTER w.pool.Start() returns
+	// to avoid a race condition between Start() and Stop() in the gocraft/work library.
 	w.context.WG.Add(1)
 	go func() {
 		defer func() {
@@ -146,13 +155,6 @@ func (w *basicWorker) Start() error {
 		w.pool.Stop()
 	}()
 
-	// Start the backend worker pool
-	// Add middleware
-	w.pool.Middleware((*workerContext).logJob)
-	// Non blocking call
-	w.pool.Start()
-	logger.Infof("Basic worker is started")
-
 	// Start the reaper
 	w.knownJobs.Range(func(k any, _ any) bool {
 		w.reaper.jobTypes = append(w.reaper.jobTypes, k.(string))

@Vad1mo

Vad1mo commented Jan 22, 2026

Copy link
Copy Markdown
Member

fix for flaky test -> #22768

@wy65701436
wy65701436 merged commit 295d094 into goharbor:main Jan 22, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/update Update or Fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants