mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
feats::
统一语言配置位置 支持langs继承 支持归类
This commit is contained in:
1 parent
5902b4d4b6
commit
377ef55d49
27 files changed
+253
-658
No files matched your search
@@ -53,15 +53,7 @@ class UiConstantsHandler extends Handler {
|
||||
}
|
||||
|
||||
async get() {
|
||||
const [LANG_TEXTS, LANG_HIGHLIGHT_ID, MONACO_MODES] = system.getMany([
|
||||
'lang.texts',
|
||||
'ui-default.lang_highlight_id',
|
||||
'ui-default.lang_monaco_modes',
|
||||
]);
|
||||
this.response.body = `\
|
||||
window.LANG_TEXTS=${JSON.stringify(yaml.load(LANG_TEXTS))};
|
||||
window.LANG_HIGHLIGHT_ID=${JSON.stringify(yaml.load(LANG_HIGHLIGHT_ID))};
|
||||
window.MONACO_MODES=${JSON.stringify(yaml.load(MONACO_MODES))}`;
|
||||
this.response.body = `window.LANGS=${JSON.stringify(system.langs)}`;
|
||||
this.response.type = 'text/javascript';
|
||||
this.ctx.set('nolog', '1');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user