ant-design/components/modal/locale.tsx

31 lines
538 B
TypeScript
Raw Normal View History

import enUS from '../locale-provider/en_US';
2017-07-31 01:50:46 +08:00
export interface ModalLocale {
okText: string;
cancelText: string;
justOkText: string;
}
const defaultLocale: ModalLocale = enUS.Modal;
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;
}