Skip to content

ConfigProvider配置国际化错误 #27662

Closed
@snoopy1412

Description

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

import React from "react";
import { ConfigProvider, Modal } from "antd";
import zhCN from "antd/lib/locale/zh_CN";
import moment from "moment";
import "moment/locale/zh-cn";
import "antd/dist/antd.css";
import "./index.css";

moment.locale("zh-cn");

const App = () => {
  const handleClick = () => {
    Modal.confirm({
      title: "第一次是中文的,点击取消后就变成了英文按钮",
    });
  };
  return (
    <ConfigProvider locale={zhCN}>
      <div style={{ width: 400, margin: "100px auto" }}>
        <div style={{ marginTop: 16 }}>
          <button onClick={handleClick}>按钮</button>
        </div>
      </div>
    </ConfigProvider>
  );
};
export default App;

What is expected?

期望 Modal.confirm 的 两个按钮均为中文

What is actually happening?

第一次为取消,确认,点击取消后,再次唤起Modal, 变成了cancel 和 ok

Environment Info
antd 4.8.2
React 17.0.1
System macOS 10.14.6
Browser chrome 86.0.4240.183

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions