ant-design/components/modal/locale.tsx
Benjy Cui 829b5f87bf feat: make default locale to enUS (#7553)
* feat: make default locale to enUS

* test: fix CI

* docs: update getting started
2017-09-26 23:12:47 +08:00

31 lines
538 B
TypeScript

import enUS from '../locale-provider/en_US';
export interface ModalLocale {
okText: string;
cancelText: string;
justOkText: string;
}
const defaultLocale: ModalLocale = enUS.Modal;
let runtimeLocale: ModalLocale = {
...defaultLocale,
};
export function changeConfirmLocale(newLocale?: ModalLocale) {
if (newLocale) {
runtimeLocale = {
...runtimeLocale,
...newLocale,
};
} else {
runtimeLocale = {
...defaultLocale,
};
}
}
export function getConfirmLocale() {
return runtimeLocale;
}