ConfigProvider 全局化配置 https://ant.design/components/config-provider-cn/

    1. function I18nLayout(props) {
    2. const [locale, setLocale] = useState({locale: 'en'});
    3. return (
    4. <ConfigProvider locale={locale}>
    5. <IntlProvider locale={locale} messages={locale.messages}>
    6. {props.children}
    7. </IntlProvider>
    8. </ConfigProvider>
    9. )
    10. }

    image.png