dev......

This commit is contained in:
Gabe Yuan
2023-08-31 00:18:57 +08:00
parent c46fe7d1c6
commit aa795e2731
21 changed files with 228 additions and 449 deletions

View File

@@ -1,4 +1,5 @@
import { CACHE_NAME } from "../config";
import { browser } from "./browser";
/**
* 清除缓存数据
@@ -10,3 +11,17 @@ export const tryClearCaches = async () => {
console.log("[clean caches]", err.message);
}
};
/**
* 本地语言识别
* @param {*} q
* @returns
*/
export const detectLang = async (q) => {
try {
const res = await browser?.i18n?.detectLanguage(q);
return res?.languages?.[0]?.language;
} catch (err) {
console.log("[detect lang]", err);
}
};