-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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(components): fix: update timepicker options when changing locale #14287
Conversation
👋 @cuongle-hdwebsoft, seems like this is your first time contribution to element-plus.
|
Hello @cuongle-hdwebsoft, thank you for contributing to element-plus, please see our guideline to see how to make contribution |
Can you provide an example of the changes before and after the modification? |
🧪 Playground Preview: https://element-plus.run/?pr=14287 |
Hi @btea, I just want to add the Here are these line that I want to add:
|
Maybe you can refer to this introduction method. playground You can refer to the dayjs file structure. |
I cannot able to import the 'ko' locale, it shows me this error @btea
Here is my playground link |
There is a problem with direct introduction, because |
So upset @btea, I don't know why the build code on your playground does not work even though I tried many times. It still worked on my local source. I copied this code from this playground and pasted that in my local source and then it worked. |
Here is my code in App.vue
Inner.vue
|
When we changed the locale, the time picker's options did not update, so it still showed the previous locale text. This MR addressed to resolve that problem. I hope that is clear to you. CleanShot.2023-09-15.at.00.14.34.mp4 |
Finally, I can reproduce this issue on your playground @btea Before fix: link Step to reproduce the issue:
Step to reproduce the fix:
|
I took a look at your code and it seems that you are translating |
Yes, that's correct @btea. |
IMO, |
Hi @btea, |
…lement-plus#14287) * fix(components): fix: update timepicker options when changing locale * fix(components): fix: update timepicker options when changing locale * fix(components): fix: update timepicker options when changing locale
Please make sure these boxes are checked before submitting your PR, thank you!
dev
branch.Description
🤖 Generated by Copilot at 4b7a6c4
Add internationalization support to
time-select
component. UseuseLocale
anddayjs
to format time based on language.Related Issue
Fixes #___.
Explanation of Changes
🤖 Generated by Copilot at 4b7a6c4
useLocale
hook to access the current language of the time-select component (link)lang
constant to store the current language value from theuseLocale
hook (link)currentTime
variable according to the current language using thelocale
method ofdayjs
intime-select.vue
(link)