mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 03:29:39 +08:00
29 lines
513 B
TypeScript
29 lines
513 B
TypeScript
import defaultLocale from '../locale-provider/default';
|
|
|
|
export interface ModalLocale {
|
|
okText: string;
|
|
cancelText: string;
|
|
justOkText: string;
|
|
}
|
|
|
|
let runtimeLocale: ModalLocale = {
|
|
...defaultLocale.Modal,
|
|
};
|
|
|
|
export function changeConfirmLocale(newLocale?: ModalLocale) {
|
|
if (newLocale) {
|
|
runtimeLocale = {
|
|
...runtimeLocale,
|
|
...newLocale,
|
|
};
|
|
} else {
|
|
runtimeLocale = {
|
|
...defaultLocale.Modal,
|
|
};
|
|
}
|
|
}
|
|
|
|
export function getConfirmLocale() {
|
|
return runtimeLocale;
|
|
}
|