ant-design/components/modal/locale.tsx

33 lines
556 B
TypeScript
Raw Normal View History

2017-07-31 01:50:46 +08:00
export interface ModalLocale {
okText: string;
cancelText: string;
justOkText: string;
}
const defaultLocale: ModalLocale = {
okText: '确定',
cancelText: '取消',
justOkText: '知道了',
};
2017-07-31 01:50:46 +08:00
let runtimeLocale: ModalLocale = {
...defaultLocale,
};
2017-07-31 01:50:46 +08:00
export function changeConfirmLocale(newLocale?: ModalLocale) {
if (newLocale) {
runtimeLocale = {
...runtimeLocale,
...newLocale,
};
} else {
runtimeLocale = {
...defaultLocale,
};
}
}
2016-05-12 15:11:25 +08:00
export function getConfirmLocale() {
return runtimeLocale;
}