Skip to content

kyverno: Enable i18n — generated en catalog + headlamp.i18n declaration - #1241

Open
productiondown wants to merge 1 commit into
headlamp-k8s:mainfrom
productiondown:kyverno-i18n-catalog
Open

kyverno: Enable i18n — generated en catalog + headlamp.i18n declaration#1241
productiondown wants to merge 1 commit into
headlamp-k8s:mainfrom
productiondown:kyverno-i18n-catalog

Conversation

@productiondown

Copy link
Copy Markdown

Fixes #1239 — the kyverno plugin renders raw i18next placeholders ({{pct}}% compliant, Pass: {{count}}, …) because it ships no locale catalog and declares no headlamp.i18n, so the plugin i18n loader (frontend/src/plugin/pluginI18n.ts, #4854 scoping) never loads resources and interpolation never runs.

The change is the verbatim output of this repo's own toolingnpm run i18n en in kyverno/:

  • kyverno/locales/en/translation.json — 155 keys extracted from the t() call sites (identity mapping; _one/_other plural variants for the {{count}} keys), same shape as the flux plugin's catalog
  • kyverno/package.json"headlamp": {"i18n": ["en"]}, same shape and position as flux's

Verified:

Notes for review:

  • Identity mapping (English key → same string) is deliberate: resolution is what re-arms interpolation; real translations can follow through the usual i18n pipeline.
  • Only en is declared, matching flux — each declared locale is fetched per #4854, so locales are added as their files are.
  • Scoped to kyverno only; happy to follow up for other catalog-less plugins if wanted.

Fixes the plugin rendering raw i18next placeholders ('{{pct}}% compliant',
'Pass: {{count}}', ...) in the compliance badge and everywhere else it
interpolates: the release ships no locale catalog and declares no
headlamp.i18n, so the frontend's plugin i18n loader (which only fetches
locales a plugin declares, per #4854's scoping) never loads resources and
interpolation never runs.

Both files are the verbatim output of the repo's own tooling:
`npm run i18n en` (registers the locale in package.json and extracts the
155-key en catalog from the t() call sites, with _one/_other plural
variants). `headlamp-plugin package` includes locales/ in the artifact
automatically — verified by packaging.

lint/tsc/test/build green on Node 20, matching CI. Rendered on Headlamp
v0.45.0 in-cluster: the badge shows numbers with these two files present
and raw placeholders without them.

Fixes headlamp-k8s#1239

Signed-off-by: productiondown <productiondown@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kyverno: release ships no i18n catalog — UI renders raw '{{pct}}% compliant' / '{{count}}' placeholders

1 participant