2017-09-26 23:12:47 +08:00
|
|
|
import enUS from '../locale-provider/en_US';
|
|
|
|
|
2017-07-31 01:50:46 +08:00
|
|
|
export interface ModalLocale {
|
|
|
|
okText: string;
|
|
|
|
cancelText: string;
|
|
|
|
justOkText: string;
|
|
|
|
}
|
|
|
|
|
2017-09-26 23:12:47 +08:00
|
|
|
const defaultLocale: ModalLocale = enUS.Modal;
|
2016-05-12 13:25:00 +08:00
|
|
|
|
2017-07-31 01:50:46 +08:00
|
|
|
let runtimeLocale: ModalLocale = {
|
2017-07-03 16:57:11 +08:00
|
|
|
...defaultLocale,
|
|
|
|
};
|
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 = {
|
|
|
|
...defaultLocale,
|
|
|
|
};
|
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;
|
|
|
|
}
|