Docs: Document en-US runtime loading skip for Grafana 13.1.0#2645
Draft
hugohaggmark wants to merge 1 commit into
Draft
Docs: Document en-US runtime loading skip for Grafana 13.1.0#2645hugohaggmark wants to merge 1 commit into
hugohaggmark wants to merge 1 commit into
Conversation
Starting with Grafana 13.1.0, Grafana no longer fetches en-US translation resources at runtime; the strings come from defaults in source code (the second argument of t() and the children of Trans). Update the plugin internationalization guides to note this, explain the kilobyte savings, and walk through how to declare plural defaults inline using defaultValue_one / defaultValue_other and the Trans tOptions prop. Refs: - grafana/grafana#125327 - grafana/grafana#125312 - grafana/grafana#125316 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Hello! 👋 This repository uses Auto for releasing packages using PR labels. ✨ This PR can be merged. It will not be considered when calculating future versions of the npm packages and will not appear in the changelogs. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Starting with Grafana 13.1.0 (grafana/grafana#125327, originally grafana/grafana#120923 and grafana/grafana#122188), Grafana no longer fetches
en-UStranslation resources at runtime. The strings are already embedded in source via the second argument oft()and the children of<Trans>, so this saves the browser from downloading a translation file the bundle already contains.This PR updates the plugin internationalization guides to:
en-USis rendered from source defaults and thatsrc/locales/en-US/<plugin-id>.jsonis generated for translation tooling only.loadResourcesfunction (Grafana 11 flow) is no longer invoked foren-US, but is still called for every other listed language.defaultValue_one/defaultValue_otherfort()and thetOptionsprop for<Trans>, mirroring the patterns landed in i18n: move plural defaults of t() calls into options object grafana#125312 and i18n: move plural defaults of Trans components into tOptions grafana#125316.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Draft until grafana/grafana#125327 lands. The exact version number (13.1.0) should also be re-verified at that time.
🤖 Generated with Claude Code