Welcome to OGeek Q&A 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 单独修改国际化语言为中文不管用?

依赖库版本: antd@4.6.6、 moment@2.29.1

使用 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 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...