-
Notifications
You must be signed in to change notification settings - Fork 65
[wip]: Add i18n support for the basic panel plugin #588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
eebe9dc
to
131e537
Compare
4204c80
to
63491f7
Compare
grafana/i18n@12.2.0 is out the door 👍 |
There was a problem hiding this 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", |
There was a problem hiding this comment.
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?
"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", |
There was a problem hiding this comment.
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 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this 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
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
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
andgrafana/i18n
, but the changes are still ready for review. A proper release ofplugin-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?