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

[Question] How how can I configure the CLI locale to use english? #10906

Closed
TheBearodactyl opened this issue Aug 23, 2023 · 1 comment
Closed
Labels

Comments

@TheBearodactyl
Copy link

TheBearodactyl commented Aug 23, 2023

I'd like to use ant and its CLI, but I can't read a single thing that the CLI outputs. Is there an option I can set with the pro command, or a variable I can set in some sort of configuration file to have it output in english?

Translation if needed:
我想使用 ant 及其 CLI,但我无法读取 CLI 输出的任何内容。是否有一个我可以使用 pro 命令设置的选项,或者我可以在某种配置文件中设置一个变量以使其以英语输出?

(sorry if the translation doesn't make that much sense, I used google translate)

@chenshuai2144
Copy link
Collaborator

To configure the CLI locale to use English with Ant Design, you can use the --locale option when running the CLI commands. For example, if you are using the pro command, you can set the locale to English by running pro --locale=en-US. This will make the CLI output in English.

If you want to change the default language of your components from English to Chinese, you can use the ConfigProvider component provided by Ant Design. Wrap your application with the ConfigProvider component and set the locale prop to 'zh_CN'. This will ensure that the components are rendered in Chinese.

If the internationalization of the date components is still not working, make sure to also configure dayjs.locale('zh-cn') and check if the version of dayjs in your project and the version that antd depends on are consistent.

Remember to use the latest and recommended practices in your front-end development, such as using Design Tokens for styling, React Hooks for managing state, and avoiding libraries like DVA and Redux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants