mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix availableLangs
This commit is contained in:
1 parent
2a66302c9e
commit
0c277f2224
5 files changed
+19
-19
No files matched your search
@@ -0,0 +1,12 @@
|
||||
const prefixes = new Set(Object.keys(LANGS).filter((i) => i.includes('.')).map((i) => i.split('.')[0]));
|
||||
|
||||
export default function getAvailableLangs(langsList?: string[]) {
|
||||
const Langs = {};
|
||||
for (const key in LANGS) {
|
||||
if (prefixes.has(key)) continue;
|
||||
if (langsList && !langsList.includes(key)) continue;
|
||||
if (LANGS[key].hidden && !langsList?.includes(key)) continue;
|
||||
Langs[key] = LANGS[key];
|
||||
}
|
||||
return Langs;
|
||||
}
|
||||
Reference in new issue
Block a user