mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: use langConfig.hidden for remote problems
This commit is contained in:
1 parent
73b1a04bd0
commit
d60f31c427
10 files changed
+28
-27
No files matched your search
@@ -10,8 +10,8 @@ export interface LangConfig {
|
||||
domain: string[];
|
||||
display: string;
|
||||
target?: string;
|
||||
sub?: LangConfig[];
|
||||
key: string;
|
||||
hidden: boolean;
|
||||
}
|
||||
|
||||
export function parseLang(config: string): Record<string, LangConfig> {
|
||||
@@ -23,13 +23,8 @@ export function parseLang(config: string): Record<string, LangConfig> {
|
||||
if (key.includes('.')) {
|
||||
const base = key.split('.')[0];
|
||||
const baseCfg = file[base];
|
||||
if (baseCfg) {
|
||||
for (const bkey in baseCfg) {
|
||||
if (bkey === 'sub') continue;
|
||||
if (!(bkey in entry)) entry[bkey] = baseCfg[bkey];
|
||||
}
|
||||
if (baseCfg.sub) baseCfg.sub.push(entry);
|
||||
else baseCfg.sub = [entry];
|
||||
for (const bkey in baseCfg || {}) {
|
||||
if (!(bkey in entry)) entry[bkey] = baseCfg[bkey];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,6 +36,7 @@ export function parseLang(config: string): Record<string, LangConfig> {
|
||||
entry.code_file = entry.code_file || `foo.${key}`;
|
||||
entry.execute = entry.execute || '/w/foo';
|
||||
entry.key = key;
|
||||
entry.hidden = entry.hidden || false;
|
||||
}
|
||||
return file;
|
||||
}
|
||||
Reference in new issue
Block a user