core&ui: use langConfig.hidden for remote problems

This commit is contained in:
undefined committed 2022-03-12 20:49:41 +08:00
1 parent 73b1a04bd0
commit d60f31c427
10 files changed
+28 -27

No files matched your search

+4 -8
View File
@@ -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;
}