ui: enhance language selection

This commit is contained in:
undefined committed 2021-05-07 22:22:24 +08:00
1 parent 377ef55d49
commit 80ac44d98e
17 files changed
+201 -70

No files matched your search

+2 -2
View File
@@ -39,7 +39,7 @@ async function postInit() {
if (!global.Hydro.isFirstWorker) return;
const judge = require('./judge');
const { task, system } = global.Hydro.model;
const { task, system, setting } = global.Hydro.model;
const { storage } = global.Hydro.service;
const _judge = global.Hydro.handler.judge as any;
@@ -154,7 +154,7 @@ async function postInit() {
}
function getLang(lang: string) {
if (system.lang[lang]) return system.lang[lang];
if (setting.langs[lang]) return setting.langs[lang];
throw new SystemError('Unsupported language {0}.', [lang]);
}