mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 04:36:19 +08:00
29 lines
538 B
TypeScript
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;
|
|
}
|