mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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 {
|
class LanguageHandler extends ResourceHandler {
|
||||||
async all() {
|
async all({ lang }) {
|
||||||
let lang = this.session.viewLang || this.user.viewLang;
|
|
||||||
if (!global.Hydro.locales[lang]) lang = system.get('server.language');
|
if (!global.Hydro.locales[lang]) lang = system.get('server.language');
|
||||||
this.response.body = `window.LOCALES=${JSON.stringify(global.Hydro.locales[lang])};`;
|
this.response.body = `window.LOCALES=${JSON.stringify(global.Hydro.locales[lang])};`;
|
||||||
this.response.type = 'application/javascript';
|
this.response.type = 'application/javascript';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.28.0",
|
"version": "4.28.1",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
Reference in new issue
Block a user