UNPKG

ideaz-element

Version:

<p align="center"> <a href="" target="_blank" rel="noopener noreferrer"> <img src="./docs/public/logo.svg" alt="Ideaz Element" width="180" style="width: 180px;" /> </a> </p>

33 lines (32 loc) 903 B
import "../node_modules/.pnpm/lodash-unified@1.0.3_@types_lodash-es@4.17.12_lodash-es@4.17.21_lodash@4.17.21/node_modules/lodash-unified/import.mjs"; import f from "../locale/lang/zh-cn.mjs"; import { unref as u, computed as c, isRef as a, ref as o, inject as l } from "vue"; import m from "../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.mjs"; function i(r, e, t) { return m(t, r, r).replace( /\{(\w+)\}/g, (g, n) => `${(e == null ? void 0 : e[n]) ?? `{${n}}`}` ); } function s(r) { return (e, t) => i(e, t, u(r)); } function d(r) { const e = c(() => u(r).name), t = a(r) ? r : o(r); return { lang: e, locale: t, t: s(r) }; } function L(r) { const e = r || l("locale", o()); return d(c(() => e.value || f)); } export { d as buildLocaleContext, s as buildTranslator, i as translate, L as useLocale }; //# sourceMappingURL=useLocale.mjs.map