ant-design/components/modal/locale.tsx
2020-03-11 14:56:01 +08:00

29 lines
538 B
TypeScript

import defaultLocale from '../locale/default';
export interface ModalLocale {
okText: string;
cancelText: string;
justOkText: string;
}
let runtimeLocale: ModalLocale = {
...(defaultLocale.Modal as ModalLocale),
};
export function changeConfirmLocale(newLocale?: ModalLocale) {
if (newLocale) {
runtimeLocale = {
...runtimeLocale,
...newLocale,
};
} else {
runtimeLocale = {
...(defaultLocale.Modal as ModalLocale),
};
}
}
export function getConfirmLocale() {
return runtimeLocale;
}