ant-design/components/modal/locale.tsx

29 lines
536 B
TypeScript
Raw Normal View History

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