fix(components): fix: update timepicker options when changing locale#14287
fix(components): fix: update timepicker options when changing locale#14287tolking merged 5 commits intoelement-plus:devfrom
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, |

Please make sure these boxes are checked before submitting your PR, thank you!
devbranch.Description
🤖 Generated by Copilot at 4b7a6c4
Add internationalization support to
time-selectcomponent. UseuseLocaleanddayjsto format time based on language.Related Issue
Fixes #___.
Explanation of Changes
🤖 Generated by Copilot at 4b7a6c4
useLocalehook to access the current language of the time-select component (link)langconstant to store the current language value from theuseLocalehook (link)currentTimevariable according to the current language using thelocalemethod ofdayjsintime-select.vue(link)