amis-rpc-design/node_modules/antd/lib/modal/locale.js
2023-10-07 19:42:30 +08:00

28 lines
1016 B
JavaScript

"use strict";
"use client";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.changeConfirmLocale = changeConfirmLocale;
exports.getConfirmLocale = getConfirmLocale;
var _en_US = _interopRequireDefault(require("../locale/en_US"));
let runtimeLocale = Object.assign({}, _en_US.default.Modal);
let localeList = [];
const generateLocale = () => localeList.reduce((merged, locale) => Object.assign(Object.assign({}, merged), locale), _en_US.default.Modal);
function changeConfirmLocale(newLocale) {
if (newLocale) {
const cloneLocale = Object.assign({}, newLocale);
localeList.push(cloneLocale);
runtimeLocale = generateLocale();
return () => {
localeList = localeList.filter(locale => locale !== cloneLocale);
runtimeLocale = generateLocale();
};
}
runtimeLocale = Object.assign({}, _en_US.default.Modal);
}
function getConfirmLocale() {
return runtimeLocale;
}