Create Plugin: add loadResources in scenes template#2477
Open
hugohaggmark wants to merge 2 commits intomainfrom
Open
Create Plugin: add loadResources in scenes template#2477hugohaggmark wants to merge 2 commits intomainfrom
hugohaggmark wants to merge 2 commits intomainfrom
Conversation
Contributor
0d18897 to
1a5688d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves plugin internationalization guidance and scaffolding for plugins that use @grafana/scenes, ensuring Scenes translation resources get loaded during plugin translation initialization.
Changes:
- Update the
scenes-apptemplate to pass@grafana/scenesloadResourcesintoinitPluginTranslations. - Clarify i18n docs by splitting
module.tsinitialization instructions for plugins with and without@grafana/scenes. - Extend the Grafana <12.1.0 doc to include
@grafana/scenesloader behavior across versions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/create-plugin/templates/scenes-app/src/module.tsx |
Ensures Scenes i18n resources are loaded by adding loadResources to initPluginTranslations. |
docusaurus/docs/how-to-guides/plugin-internationalization.md |
Adds separate module.ts initialization examples for plugins that do and don’t use @grafana/scenes. |
docusaurus/docs/how-to-guides/plugin-internationalization-grafana-11.md |
Adds version-aware initialization example that includes the Scenes loader even when Grafana loads plugin resources. |
jackw
approved these changes
Feb 24, 2026
| import pluginJson from 'plugin.json'; | ||
|
|
||
| await initPluginTranslations(pluginJson.id); | ||
| await initPluginTranslations(pluginJson.id, [loadResources]); |
Collaborator
There was a problem hiding this comment.
Is this enough or do we need the scenes esm build fix merged and then bump scenes in the package.json template too?
Contributor
Author
There was a problem hiding this comment.
yes, this can't be merged until the esm fix, should I change this to a Draft PR meanwhile?
Collaborator
There was a problem hiding this comment.
Nah, it's fine. I just wanted to make sure what order things needed to happen in. 👍
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:
This pull request updates the internationalization (i18n) setup instructions and templates for Grafana plugins, particularly improving support for plugins that use
@grafana/scenes. The documentation is now clearer about the differences in translation initialization for plugins with and without@grafana/scenes, and the plugin template code is updated to properly load translation resources when@grafana/scenesis used.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
📦 Published PR as canary version:
Canary Versions✨ Test out this PR locally via:
npm install @grafana/create-plugin@6.10.2-canary.2477.22383481688.0 # or yarn add @grafana/create-plugin@6.10.2-canary.2477.22383481688.0