Change translated text for selected time #4271
Unanswered
shuvro1226
asked this question in
Q&A
Replies: 1 comment
-
You can customize your language translations in the following way. I've included the necessary parts of my code to help you copy and adapt it for your needs. In this example, I modify the Persian translation of AM and PM to custom values. I then spread the rest of the language translations and overwrite the specific sections I want to change. Finally, I use the modified object in the locale of the date picker. Here’s how you can do it:
Then use the custom locale in your component like this:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using
react-datepicker
package for date and time picking. I am passing language dynamically to the datepicker via locale prop for setting the language of the date and time picker. For the time picker, when the locale is set asde
it translates AM/PM tovormittags/machmittags
based on the selected time. I want to change that toUhr
instead. But reading their documentation it seems to be not supported by default. I need some suggestions on if it's possible to achieve this somehow while using the package.Here's the time picker code -
Beta Was this translation helpful? Give feedback.
All reactions