ant-design/components/modal/locale.tsx

29 lines
504 B
TypeScript
Raw Normal View History

import defaultLocale from '../locale/default';
2017-07-31 01:50:46 +08:00
export interface ModalLocale {
okText: string;
cancelText: string;
justOkText: string;
}
let runtimeLocale: ModalLocale = {
...defaultLocale.Modal,
};
2017-07-31 01:50:46 +08:00
export function changeConfirmLocale(newLocale?: ModalLocale) {
if (newLocale) {
runtimeLocale = {
...runtimeLocale,
...newLocale,
};
} else {
runtimeLocale = {
...defaultLocale.Modal,
};
}
}
2016-05-12 15:11:25 +08:00
export function getConfirmLocale() {
return runtimeLocale;
}