UNPKG

e-virt-table

Version:

A powerful data table based on canvas. You can use it as data grid、Microsoft Excel or Google sheets. It supports virtual scroll、cell edit etc.

26 lines 769 B
import EVirtTable from './EVirtTable'; import defaultLang from './lang/zh-CN'; export default class Locale { constructor() { Object.defineProperty(this, "langConfig", { enumerable: true, configurable: true, writable: true, value: void 0 }); } use(langConfig) { this.langConfig = langConfig; } getText(key, params) { const config = { ...defaultLang }; // 合并全局默认语言配置 Object.assign(config, EVirtTable.locale, this.langConfig); const text = config[key]; if (!text) { return ''; } return text.replace(/{(\w+)}/g, (match, p1) => params?.[p1] || match); } } //# sourceMappingURL=Locale.js.map