ant-design/components/modal/locale.tsx
Chuns Chen cc5c4fed51
refactor: locale files reference path (#38194)
* chore: add locale files to npm pkg

* docs: locale files reference path

* docs: fix locale path

* chore: bump @ant-design/tools

* refactor: default locale file

* chore: add site wepack alias

* chore: bump @ant-design/tools

* fix: site theme locale reference path

* chore: add locale files to eslint ignore

* fix: markdown demo unable to resolve path to module antd/locale
2022-10-26 14:38:54 +08:00

29 lines
536 B
TypeScript

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