-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
fix(issue): 30131 #31751
base: master
Are you sure you want to change the base?
fix(issue): 30131 #31751
Conversation
this is to propagate the current locale up to the echarts configuration.
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.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Fix Detected |
---|---|---|
Unsafe Dynamic Module Import ▹ view | ✅ | |
Missing Locale Fallback ▹ view | ✅ | |
Missing locale state fallback ▹ view | ✅ |
Need a new review? Comment
/korbit-review
on this PR and I'll review your latest changes.Korbit Guide: Usage and Customization
Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-review
command in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-description
command in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolve
command in any comment on your PR.- Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.
Customizing Korbit
- Check out our docs on how you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console.
Feedback and Support
@@ -123,10 +127,14 @@ function Echart( | |||
getEchartInstance: () => chartRef.current, | |||
})); | |||
|
|||
const localeObj = useSelector((state: ExplorePageState) => state?.common?.locale); | |||
const lang = require('echarts/lib/i18n/lang' + localeObj.toUpperCase()).default; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@@ -123,10 +127,14 @@ | |||
getEchartInstance: () => chartRef.current, | |||
})); | |||
|
|||
const localeObj = useSelector((state: ExplorePageState) => state?.common?.locale); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
done
@@ -123,10 +127,14 @@ | |||
getEchartInstance: () => chartRef.current, | |||
})); | |||
|
|||
const localeObj = useSelector((state: ExplorePageState) => state?.common?.locale); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
done
fixes suggested by bot
removing trailing whitespaces
prettier changes
superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: JUST.in DO IT <[email protected]>
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.
Thank you for submitting this PR @jpchev , you beat me to it :)
With just a few small changes, this is working well for me.
superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx
Outdated
Show resolved
Hide resolved
…Echart.tsx Co-authored-by: Jillian <[email protected]>
…Echart.tsx Co-authored-by: Jillian <[email protected]>
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.
👍 This change is working great! Thank you @jpchev :)
- I tested this by combining it with fix(lang): patch FAB's LocaleView to redirect to previous page #31692 to test changing languages while viewing and editing the Pie Chart echart. I verified that this change ensures the "Inv" and "All" buttons on that echart are now translated as expected.
- I read through the code
SUMMARY
this is to propagate the current locale up to the echarts configuration.
fixes: #30131
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
switch the locale and verify that charts have the correct locale (for example in months name and in buttons)