Files
LingChair/mdui_patched/functions/getLocale.js
CrescentLeaf 1cb8ac3fff 移动目录
2025-11-23 13:27:15 +08:00

12 lines
410 B
JavaScript

import { getLocale as getLocaleInternal, uninitializedError, } from '../internal/localize.js';
/**
* 获取当前的语言代码。如果当前正在加载新的语言包,则该函数仍返回先前的语言代码
* @return string 当前的语言代码
*/
export const getLocale = () => {
if (!getLocaleInternal) {
throw new Error(uninitializedError);
}
return getLocaleInternal();
};