ant-design/components/modal/locale.tsx
zombieJ 81d8eb8afe
feat: ConfigProvider support locale (#17816)
* ConfigProvider support locale

* update docs

* update category

* clean up

* moving locale

* update check script

* update related code

* add test case

* demo link

* update doc

* hide one rule of md with eslint

* update error link
2019-07-24 10:34:55 +08:00

29 lines
504 B
TypeScript

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