How to translate antd validation message?

Hi, I've set the i18n locale to Chinese, using the code below:
i18n
.use(Backend)
.use(initReactI18next)
.init({
supportedLngs: ['zh-CN'],
backend: {
loadPath: '/locales/{{lng}}/{{ns}}.json', // locale files path
},
defaultNS: 'common',
fallbackLng: ['zh-CN'],
})
i18n
.use(Backend)
.use(initReactI18next)
.init({
supportedLngs: ['zh-CN'],
backend: {
loadPath: '/locales/{{lng}}/{{ns}}.json', // locale files path
},
defaultNS: 'common',
fallbackLng: ['zh-CN'],
})
How ever when I use ant design validation rules, the antd validation (required) message is still English. How can I translate these validatiion messages? (I assume that antd has built-in i18n system as well. How to use its i18n settings with refine.dev?)
2 Replies
rival-black
rival-black2y ago
Hey @_erichu I think this issue is not related to refine. This doc will help you. https://ant.design/docs/react/i-18-n
fascinating-indigo
fascinating-indigo2y ago
Hi @yildirayunlu thanks it worked!