Skip to content

frontend: plugins: Only fetch the active locale for plugin i18n#6112

Open
r0hansaxena wants to merge 2 commits into
kubernetes-sigs:mainfrom
r0hansaxena:fix/4854-plugin-i18n-404
Open

frontend: plugins: Only fetch the active locale for plugin i18n#6112
r0hansaxena wants to merge 2 commits into
kubernetes-sigs:mainfrom
r0hansaxena:fix/4854-plugin-i18n-404

Conversation

@r0hansaxena

Copy link
Copy Markdown
Contributor

Summary

Fixes a flood of 404 requests for plugin translation files. Plugin i18n eagerly fetched a translation.json for every locale a plugin declares, so a plugin declaring many locales whose files aren't present produced a 404 per missing locale on every render, enough to trip rate limiters like CrowdSec. Reported for the Prometheus plugin, but the fix applies to all plugins.

Related Issue

Fixes #4854

Changes

  • Plugin i18n now eagerly loads only the active language (plus the en fallback) instead of every declared locale
  • Other locales are loaded lazily on language switch
  • Plugins that declare no locales are skipped entirely (no probing)
  • Added unit tests for the above

Steps to Test

  1. Use a plugin that declares multiple locales but ships no translations
  2. Check the Network tab filtered by the plugin name
  3. Before: one 404 per declared locale. After: only the active language is fetched

Screenshots (if applicable)

Before:

image

After:

image

Notes for the Reviewer

  • Only changes how the frontend loads plugin translations. If the translation files are missing from the build itself, that's a separate packaging fix.

Signed-off-by: Rohan Saxena <rohansxn8772@gmail.com>
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: r0hansaxena
Once this PR has been reviewed and has the lgtm label, please assign illume for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from kahirokunn and sniok June 20, 2026 07:01
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 20, 2026
@r0hansaxena

Copy link
Copy Markdown
Contributor Author

I'll address the failing check

@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: r0hansaxena
Once this PR has been reviewed and has the lgtm label, please assign illume for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Helm deployment is requesting missing translations

2 participants