2017-10-26 10:50:18 +08:00
|
|
|
import defaultLocale from '../locale-provider/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 = {
|
2017-10-26 10:50:18 +08:00
|
|
|
...defaultLocale.Modal,
|
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 = {
|
2017-10-26 10:50:18 +08:00
|
|
|
...defaultLocale.Modal,
|
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;
|
|
|
|
}
|