mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +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;
|
|
}
|