mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +08:00
829b5f87bf
* feat: make default locale to enUS * test: fix CI * docs: update getting started
31 lines
538 B
TypeScript
31 lines
538 B
TypeScript
import enUS from '../locale-provider/en_US';
|
|
|
|
export interface ModalLocale {
|
|
okText: string;
|
|
cancelText: string;
|
|
justOkText: string;
|
|
}
|
|
|
|
const defaultLocale: ModalLocale = enUS.Modal;
|
|
|
|
let runtimeLocale: ModalLocale = {
|
|
...defaultLocale,
|
|
};
|
|
|
|
export function changeConfirmLocale(newLocale?: ModalLocale) {
|
|
if (newLocale) {
|
|
runtimeLocale = {
|
|
...runtimeLocale,
|
|
...newLocale,
|
|
};
|
|
} else {
|
|
runtimeLocale = {
|
|
...defaultLocale,
|
|
};
|
|
}
|
|
}
|
|
|
|
export function getConfirmLocale() {
|
|
return runtimeLocale;
|
|
}
|