mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
ui: fix lang js generation
This commit is contained in:
1 parent
a5e97c141a
commit
e747284679
2 files changed
+2
-3
No files matched your search
@@ -123,8 +123,7 @@ class UiConstantsHandler extends ResourceHandler {
|
||||
}
|
||||
|
||||
class LanguageHandler extends ResourceHandler {
|
||||
async all() {
|
||||
let lang = this.session.viewLang || this.user.viewLang;
|
||||
async all({ lang }) {
|
||||
if (!global.Hydro.locales[lang]) lang = system.get('server.language');
|
||||
this.response.body = `window.LOCALES=${JSON.stringify(global.Hydro.locales[lang])};`;
|
||||
this.response.type = 'application/javascript';
|
||||
|
||||
Reference in new issue
Block a user