Skip to content
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

DatePicker(Today ) text not localizing #24497

Closed
1 task done
AbhijeetGaware opened this issue May 27, 2020 · 28 comments · Fixed by #24609
Closed
1 task done

DatePicker(Today ) text not localizing #24497

AbhijeetGaware opened this issue May 27, 2020 · 28 comments · Fixed by #24609
Labels
🤔 Need Reproduce We cannot reproduce your problem

Comments

@AbhijeetGaware
Copy link
Contributor

AbhijeetGaware commented May 27, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://ant.design/components/date-picker/

Steps to reproduce

We are trying to localize DatePicker based on browser locale

It will be good if can override today text with parameter

Eg., <DatePicker todayText={"Manual Today}/> // We can take care of localizing using react-intil if this parameter exist

We tried below work-around based on antd recommended localization. It is not working for all countries (Eg., Ireland - ga)

import zh_CN from 'antd/lib/date-picker/locale/zh_CN';
Date Picker Calender localizing perfectly. //

What is expected?

DatePicker should have todayText attribute to override/localize the value

What is actually happening?

Unable to localize Today text for all required countries part of our requirement

Environment Info
antd 3.26.13
React 16.13.0
System MacBookPro
Browser Chrome 81.0.4044.138
@afc163 afc163 added the 🤔 Need Reproduce We cannot reproduce your problem label May 27, 2020
@ant-design-bot
Copy link
Contributor

Hello @AbhijeetGaware. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro or a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 7 days.

你好 @AbhijeetGaware, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。7 天内未跟进的 issue 将会被自动关闭。

@AbhijeetGaware
Copy link
Contributor Author

@yoyo837
Copy link
Contributor

yoyo837 commented May 27, 2020

Your link is not version 3.

@afc163
Copy link
Member

afc163 commented May 27, 2020

@afc163 afc163 closed this as completed May 27, 2020
@yoyo837
Copy link
Contributor

yoyo837 commented May 27, 2020

A set of localization is indecomposable.

@AbhijeetGaware
Copy link
Contributor Author

AbhijeetGaware commented May 27, 2020

indecomposable.

i need to change today text for few countries (eg.Ireland:-irish) rest of few countries working fine

@yoyo837
Copy link
Contributor

yoyo837 commented May 27, 2020

Maybe you should add en_IE locale for antd

@AbhijeetGaware
Copy link
Contributor Author

Maybe you should add en_IE locale for antd

i have tried that its shows error antd cant find module
Screenshot 2020-05-27 at 4 48 05 PM

@yoyo837
Copy link
Contributor

yoyo837 commented May 27, 2020

There is no i18n of en_IE currently, need you to help add it.

@AbhijeetGaware
Copy link
Contributor Author

There is no i18n of en_IE currently, need you to help add it.

how to change (Today) text will you provide any parameter for (irish),(ireland)

@AbhijeetGaware
Copy link
Contributor Author

There is no i18n of en_IE currently, need you to help add it.

how to change (Today) text will you provide any parameter for (irish),(ireland)

i need to locale for irish (ga_IE) and need to work for antd

@yoyo837
Copy link
Contributor

yoyo837 commented May 27, 2020

There is no internationalization of these areas yet, welcome to send us PR to add them.

en_IE, ga_IE and any other internationalization that we have not added yet.

image

@AbhijeetGaware
Copy link
Contributor Author

@yoyo837 i need to translate Today text when it will be added will you let me know
or you can provide me how to override today text manually for DatePicker

@AbhijeetGaware
Copy link
Contributor Author

https://codesandbox.io/embed/antd-reproduction-template-46ilm?fontsize=14&hidenavigation=1&theme=dark

i was trying to do what you said please see the once Thank You

@yoyo837
Copy link
Contributor

yoyo837 commented May 27, 2020

Do you mean that you don't know how to contribute an i18n locale?

@AbhijeetGaware
Copy link
Contributor Author

Do you mean that you don't know how to contribute an i18n locale?

yes i know it and i tried it but still its not taking locale in DatePicker

@AbhijeetGaware
Copy link
Contributor Author

Screenshot 2020-05-27 at 5 34 35 PM

afc163 added a commit that referenced this issue May 27, 2020
@yoyo837
Copy link
Contributor

yoyo837 commented May 27, 2020

What is the output of navigator.language on your computer?

@AbhijeetGaware
Copy link
Contributor Author

What is the output of navigator.language on your computer?

what i selected languages on browser locale its properly working fine only i am stuck with irish

@yoyo837
Copy link
Contributor

yoyo837 commented May 28, 2020

https://ant.design/docs/react/i18n#Adding-newplanguage
If your language is not in above list, feel free to create a locale package based on en_US and send us a pull request. This Azerbaijani language PR could be a sample.

@yoyo837
Copy link
Contributor

yoyo837 commented May 28, 2020

You need to send PR to rc-picker like react-component/picker#24 and rc-pagination like react-component/pagination#249 before send PR to antd.

@AbhijeetGaware
Copy link
Contributor Author

You need to send PR to rc-picker like react-component/picker#24 and rc-pagination like react-component/pagination#249 at first.

@yoyo837 okay Thank you

@AbhijeetGaware
Copy link
Contributor Author

@AbhijeetGaware
Copy link
Contributor Author

#24586

@AbhijeetGaware
Copy link
Contributor Author

@AbhijeetGaware
Copy link
Contributor Author

https://ant.design/docs/react/i18n#Adding-newplanguage
If your language is not in above list, feel free to create a locale package based on en_US and send us a pull request. This Azerbaijani language PR could be a sample.

@yoyo837 Some checks were not succesfull . i have added 2 file from rc-picker in ant-design component so should i have to delete those file or i have to raise pr again for ant-design

@yoyo837
Copy link
Contributor

yoyo837 commented May 30, 2020

Wait for the PRs of the Picker and Pagination to merge and release a new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 Need Reproduce We cannot reproduce your problem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants