Skip to content

Conversation

sunker
Copy link
Contributor

@sunker sunker commented Sep 19, 2025

This PR introduces i18n support for the basic-panel plugin with Swedish (supported in Grafana 11 and later) and Spanish translations.

At the moment, the implementation relies on pre-release versions of grafana/plugin-e2e and grafana/i18n, but the changes are still ready for review. A proper release of plugin-e2e will follow and this PR will be updated accordingly.

@hugohaggmark I guess we should hold off on merging and releasing this until grafana/i18n@12.2.0 is out the door?

@sunker sunker self-assigned this Sep 19, 2025
@sunker sunker moved this from 📬 Triage to 🧑‍💻 In development in Plugins Platform / Grafana Community Sep 19, 2025
@sunker sunker force-pushed the panel-plugin-i18n branch 2 times, most recently from eebe9dc to 131e537 Compare September 23, 2025 08:11
@hugohaggmark
Copy link
Contributor

grafana/i18n@12.2.0 is out the door 👍

Copy link
Contributor

@hugohaggmark hugohaggmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 🎉 an I just had one question 👍

},
"dependencies": {
"grafanaDependency": ">=10.4.0",
"grafanaDependency": ">=11.4.8",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Silly question but doesn't 11.0.0 work?

Suggested change
"grafanaDependency": ">=11.4.8",
"grafanaDependency": ">=11.0.0",

"@emotion/css": "11.10.6",
"@grafana/data": "^12.1.0",
"@grafana/i18n": "^12.1.0",
"@grafana/i18n": "12.2.0-17630182352",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a 12.2.0 version out now 👍

@github-project-automation github-project-automation bot moved this from 🧑‍💻 In development to 🔬 In review in Plugins Platform / Grafana Community Sep 25, 2025
@sunker sunker marked this pull request as ready for review September 25, 2025 12:33
@sunker sunker requested review from a team as code owners September 25, 2025 12:33
Copy link
Contributor

@mckn mckn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@academo academo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these plugins examples are auto generated and they are automatically updated every sunday. If you merge these changes they'll be overwritten on the next merge.

You should instead update the templates in plugin tools

@github-project-automation github-project-automation bot moved this from 🔬 In review to 🧑‍💻 In development in Plugins Platform / Grafana Community Oct 13, 2025
sunker added a commit to grafana/plugin-tools that referenced this pull request Oct 17, 2025
Implements complete i18n setup automation:
- Updates docker-compose.yaml with localizationForPlugins feature toggle
- Updates plugin.json with languages array and grafanaDependency >= 12.1.0
- Creates locale folders and translation files for selected locales
- Adds @grafana/i18n dependency to package.json
- Adds i18next-cli dev dependency and i18n-extract script
- Creates i18next.config.ts with proper extraction configuration
- Updates eslint.config.mjs with i18n linting rules
- Adds i18n imports to module.ts/tsx automatically
- Idempotent: safely runs multiple times without breaking
- Comprehensive test suite with 8 passing tests covering:
  * Idempotency verification
  * Single and multiple locale support
  * Skipping when already configured
  * Handling existing feature toggles
  * Support for both .ts and .tsx modules
  * Version-aware dependency updates
  * Edge cases (missing scripts, etc.)

This automates all manual steps shown in grafana/grafana-plugin-examples#588
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🧑‍💻 In development

Development

Successfully merging this pull request may close these issues.

4 participants