mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
cc5c4fed51
* 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
29 lines
536 B
TypeScript
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;
|
|
}
|