ant-design/components/modal/locale.tsx
2017-07-31 01:50:46 +08:00

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;
}