mdui
Version:
实现 material you 设计规范的 Web Components 组件库
12 lines (11 loc) • 383 B
JavaScript
import { setLocale as setLocaleInternal, uninitializedError, } from '../internal/localize.js';
/**
* 切换到指定的语言。返回 Promise,在新的语言包加载完成后 resolve
* @param locale 语言代码
*/
export const setLocale = (locale) => {
if (!setLocaleInternal) {
throw new Error(uninitializedError);
}
return setLocaleInternal(locale);
};