Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.4k views
in Technique[技术] by (71.8m points)

ant design 使用 DatePicker 单独修改国际化语言为中文不管用?

依赖库版本: [email protected][email protected]

使用 codesandbox 的演示:

image.png

配置 locale 后:
image.png

演示是正常的!

_

项目中代码是一样的,可是国际化语言没有被更改:
    import "moment/locale/zh-cn";
    import locale from "antd/es/date-picker/locale/zh_CN"; 
    
    <DatePicker locale={locale} />
     

还是跟之前一样:
image.png

全局也没有做统一的配置,请问是怎么回事?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

datepicker中国际化还要做日历的国际化。看源码国际化分两部分。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...