UNPKG

@etsoo/editor

Version:

ETSOO Free WYSIWYG HTML Editor

29 lines (26 loc) 847 B
import { DomUtils } from '@etsoo/shared'; const zhHans = DomUtils.zhHans(async () => { const labels = await import('../i18n/zh-Hans.json.js'); return labels.default ?? labels; }); const zhHant = DomUtils.zhHant(async () => { const labels = await import('../i18n/zh-Hant.json.js'); return labels.default ?? labels; }); const en = DomUtils.en(async () => { const labels = await import('../i18n/en.json.js'); return labels.default ?? labels; }); /** * EOEditor get labels * @param language Language * @returns Language labels */ async function EOEditorGetLabels(language) { const culture = DomUtils.getCulture([en, zhHans, zhHant], language)[0] ?? en; if (typeof culture.resources === "object") return culture.resources; else return await culture.resources(); } export { EOEditorGetLabels };