mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 13:47:02 +08:00
33 lines
556 B
TypeScript
33 lines
556 B
TypeScript
export interface ModalLocale {
|
|
okText: string;
|
|
cancelText: string;
|
|
justOkText: string;
|
|
}
|
|
|
|
const defaultLocale: ModalLocale = {
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
justOkText: '知道了',
|
|
};
|
|
|
|
let runtimeLocale: ModalLocale = {
|
|
...defaultLocale,
|
|
};
|
|
|
|
export function changeConfirmLocale(newLocale?: ModalLocale) {
|
|
if (newLocale) {
|
|
runtimeLocale = {
|
|
...runtimeLocale,
|
|
...newLocale,
|
|
};
|
|
} else {
|
|
runtimeLocale = {
|
|
...defaultLocale,
|
|
};
|
|
}
|
|
}
|
|
|
|
export function getConfirmLocale() {
|
|
return runtimeLocale;
|
|
}
|