From 68d068c8a078d23a2bc8505f564568aba94a5cfb Mon Sep 17 00:00:00 2001 From: productiondown Date: Mon, 24 Aug 2026 15:03:38 -0600 Subject: [PATCH] =?UTF-8?q?kyverno:=20Enable=20i18n=20=E2=80=94=20generate?= =?UTF-8?q?d=20en=20catalog=20+=20headlamp.i18n=20declaration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #1239 Signed-off-by: productiondown --- kyverno/locales/en/translation.json | 157 ++++++++++++++++++++++++++++ kyverno/package.json | 5 + 2 files changed, 162 insertions(+) create mode 100644 kyverno/locales/en/translation.json diff --git a/kyverno/locales/en/translation.json b/kyverno/locales/en/translation.json new file mode 100644 index 0000000000..d903981aea --- /dev/null +++ b/kyverno/locales/en/translation.json @@ -0,0 +1,157 @@ +{ + "Validating Policies": "Validating Policies", + "Name": "Name", + "Ready": "Ready", + "Actions": "Actions", + "Validations": "Validations", + "Mutating Policies": "Mutating Policies", + "Mutations": "Mutations", + "Generating Policies": "Generating Policies", + "Generators": "Generators", + "Deleting Policies": "Deleting Policies", + "Schedule": "Schedule", + "Match Constraints": "Match Constraints", + "Resource Rules": "Resource Rules", + "API Groups": "API Groups", + "API Versions": "API Versions", + "Operations": "Operations", + "Resources": "Resources", + "Other Constraints": "Other Constraints", + "Validation Actions": "Validation Actions", + "Kind": "Kind", + "Created": "Created", + "Overview": "Overview", + "Variables": "Variables", + "Expression": "Expression", + "Message": "Message", + "Reason": "Reason", + "Audit Annotations": "Audit Annotations", + "Key": "Key", + "Value Expression": "Value Expression", + "Patch Type": "Patch Type", + "Namespace": "Namespace", + "Conditions": "Conditions", + "Cleanup Policies": "Cleanup Policies", + "Last Execution": "Last Execution", + "Cluster Cleanup Policies": "Cluster Cleanup Policies", + "Cluster Policies": "Cluster Policies", + "Action": "Action", + "Background": "Background", + "Rule Types": "Rule Types", + "Rules": "Rules", + "Results": "Results", + "{{fail}} / {{total}} failed": "{{fail}} / {{total}} failed", + "Cluster Policy Reports": "Cluster Policy Reports", + "Scope": "Scope", + "Pass": "Pass", + "Fail": "Fail", + "Warn": "Warn", + "Error": "Error", + "Skip": "Skip", + "Summary": "Summary", + "kyverno.learnAboutInstalling": "kyverno.learnAboutInstalling", + "Kyverno Compliance": "Kyverno Compliance", + "No policy reports yet.": "No policy reports yet.", + "{{pct}}% compliant": "{{pct}}% compliant", + "Pass: {{count}}_one": "Pass: {{count}}", + "Pass: {{count}}_other": "Pass: {{count}}", + "Fail: {{count}}_one": "Fail: {{count}}", + "Fail: {{count}}_other": "Fail: {{count}}", + "Warn: {{count}}_one": "Warn: {{count}}", + "Warn: {{count}}_other": "Warn: {{count}}", + "Error: {{count}}_one": "Error: {{count}}", + "Error: {{count}}_other": "Error: {{count}}", + "Skip: {{count}}_one": "Skip: {{count}}", + "Skip: {{count}}_other": "Skip: {{count}}", + "View all violations": "View all violations", + "Kyverno (kyverno.io/v1) was not detected on this cluster.": "Kyverno (kyverno.io/v1) was not detected on this cluster.", + "Kyverno CEL policies (policies.kyverno.io/v1) were not detected on this cluster. Kyverno 1.14+ is required.": "Kyverno CEL policies (policies.kyverno.io/v1) were not detected on this cluster. Kyverno 1.14+ is required.", + "Kyverno cleanup policies (kyverno.io/v2) were not detected on this cluster.": "Kyverno cleanup policies (kyverno.io/v2) were not detected on this cluster.", + "Policy Reports (wgpolicyk8s.io/v1alpha2) were not detected on this cluster.": "Policy Reports (wgpolicyk8s.io/v1alpha2) were not detected on this cluster.", + "Policy Exceptions (kyverno.io/v2) were not detected on this cluster.": "Policy Exceptions (kyverno.io/v2) were not detected on this cluster.", + "Kyverno admission/background-scan reports (kyverno.io/v2) were not detected on this cluster.": "Kyverno admission/background-scan reports (kyverno.io/v2) were not detected on this cluster.", + "Kyverno ephemeral reports (reports.kyverno.io/v1) were not detected on this cluster. Kyverno 1.11+ is required.": "Kyverno ephemeral reports (reports.kyverno.io/v1) were not detected on this cluster. Kyverno 1.11+ is required.", + "Kyverno Overview": "Kyverno Overview", + "Total Policies": "Total Policies", + "Compliance": "Compliance", + "Enforce": "Enforce", + "Audit": "Audit", + "Results by Status": "Results by Status", + "Results by Severity": "Results by Severity", + "Top Failing Categories": "Top Failing Categories", + "Compliance by Namespace (Top 10)": "Compliance by Namespace (Top 10)", + "Fail/Error": "Fail/Error", + "No reports yet": "No reports yet", + "No policy results have been recorded for this cluster. Install some Kyverno policies to see compliance data here.": "No policy results have been recorded for this cluster. Install some Kyverno policies to see compliance data here.", + "Any (OR)": "Any (OR)", + "All (AND)": "All (AND)", + "Match Conditions ({{type}})": "Match Conditions ({{type}})", + "Kinds:": "Kinds:", + "Names:": "Names:", + "Namespaces:": "Namespaces:", + "Subjects:": "Subjects:", + "Details": "Details", + "Excepted Policies ({{count}})_one": "Excepted Policies ({{count}})", + "Excepted Policies ({{count}})_other": "Excepted Policies ({{count}})", + "Policy": "Policy", + "No exceptions defined.": "No exceptions defined.", + "Failed to load exception: {{error}}": "Failed to load exception: {{error}}", + "Image Validating Policies": "Image Validating Policies", + "Image Patterns": "Image Patterns", + "Attestors": "Attestors", + "Admission": "Admission", + "Enabled": "Enabled", + "Disabled": "Disabled", + "Title": "Title", + "Description": "Description", + "Category": "Category", + "Severity": "Severity", + "Image References ({{count}})_one": "Image References ({{count}})", + "Image References ({{count}})_other": "Image References ({{count}})", + "Pattern": "Pattern", + "Type": "Type", + "No image references defined.": "No image references defined.", + "Attestors ({{count}})_one": "Attestors ({{count}})", + "Attestors ({{count}})_other": "Attestors ({{count}})", + "No attestors defined.": "No attestors defined.", + "Attestations ({{count}})_one": "Attestations ({{count}})", + "Attestations ({{count}})_other": "Attestations ({{count}})", + "Format": "Format", + "Validations ({{count}})_one": "Validations ({{count}})", + "Validations ({{count}})_other": "Validations ({{count}})", + "Failed to load policy: {{error}}": "Failed to load policy: {{error}}", + "Owner": "Owner", + "Policy Exceptions": "Policy Exceptions", + "Policies": "Policies", + "Policy Reports": "Policy Reports", + "Labels": "Labels", + "Policy Metadata": "Policy Metadata", + "YAML": "YAML", + "Status": "Status", + "Last Transition": "Last Transition", + "Match Kinds": "Match Kinds", + "No rules defined.": "No rules defined.", + "Associated Report Results": "Associated Report Results", + "Associated Report Results ({{count}})_one": "Associated Report Results ({{count}})", + "Associated Report Results ({{count}})_other": "Associated Report Results ({{count}})", + "Rule": "Rule", + "Result": "Result", + "Resource": "Resource", + "No report results found for this policy.": "No report results found for this policy.", + "Failure Action": "Failure Action", + "Rules ({{count}})_one": "Rules ({{count}})", + "Rules ({{count}})_other": "Rules ({{count}})", + "Results ({{count}})_one": "Results ({{count}})", + "Results ({{count}})_other": "Results ({{count}})", + "Failed to load report: {{error}}": "Failed to load report: {{error}}", + "No results found.": "No results found.", + "Violations": "Violations", + "Violations ({{count}})_one": "Violations ({{count}})", + "Violations ({{count}})_other": "Violations ({{count}})", + "All": "All", + "Flat": "Flat", + "By Policy": "By Policy", + "By Namespace": "By Namespace", + "By Kind": "By Kind", + "No violations found.": "No violations found." +} diff --git a/kyverno/package.json b/kyverno/package.json index c8cbed0baa..81f26bd054 100644 --- a/kyverno/package.json +++ b/kyverno/package.json @@ -36,5 +36,10 @@ }, "devDependencies": { "@kinvolk/headlamp-plugin": "^0.13.1" + }, + "headlamp": { + "i18n": [ + "en" + ] } }