2019-07-24 10:34:55 +08:00
|
|
|
import defaultLocale from '../locale/default';
|
2017-09-26 23:12:47 +08:00
|
|
|
|
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-03 16:57:11 +08:00
|
|
|
};
|
2016-05-12 13:25:00 +08:00
|
|
|
|
2017-07-31 01:50:46 +08:00
|
|
|
export function changeConfirmLocale(newLocale?: ModalLocale) {
|
2016-05-12 13:25:00 +08:00
|
|
|
if (newLocale) {
|
2017-07-03 16:57:11 +08:00
|
|
|
runtimeLocale = {
|
|
|
|
...runtimeLocale,
|
|
|
|
...newLocale,
|
|
|
|
};
|
2016-05-12 13:25:00 +08:00
|
|
|
} else {
|
2017-07-03 16:57:11 +08:00
|
|
|
runtimeLocale = {
|
2020-03-11 14:56:01 +08:00
|
|
|
...(defaultLocale.Modal as ModalLocale),
|
2017-07-03 16:57:11 +08:00
|
|
|
};
|
2016-05-12 13:25:00 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-12 15:11:25 +08:00
|
|
|
export function getConfirmLocale() {
|
2016-05-12 13:25:00 +08:00
|
|
|
return runtimeLocale;
|
|
|
|
}
|