ui: fix lang js generation

This commit is contained in:
undefined committed 2022-01-08 12:55:53 +08:00
1 parent a5e97c141a
commit e747284679
2 files changed
+2 -3

No files matched your search

+1 -2
View File
@@ -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';
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.28.0",
"version": "4.28.1",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",