UNPKG

@antv/s2

Version:

effective spreadsheet render core lib

28 lines 750 B
import { get, merge } from 'lodash'; import { EN_US as BASE_EN_US } from './en_US'; import { RU as BASE_RU } from './ru_RU'; import { ZH_CN as BASE_ZH_CN } from './zh_CN'; const DEFAULT_LANG = 'zh_CN'; let lang = DEFAULT_LANG; let locale = { zh_CN: BASE_ZH_CN, en_US: BASE_EN_US, ru_RU: BASE_RU, }; export const getLang = () => lang; /** * 设置语言 * @param lang */ export const setLang = (langType) => { lang = langType || DEFAULT_LANG; }; /** * 拓展locale配置 */ export const extendLocale = (extraLocale) => { locale = merge({}, locale, extraLocale); }; export const getLocale = () => locale; export const i18n = (key, defaultValue = key) => get(locale, [lang, key], defaultValue); //# sourceMappingURL=index.js.map