core&ui: i18n: fix serialize

This commit is contained in:
undefined committed 2022-11-05 18:07:05 +08:00
1 parent e1228345b0
commit 4976f94ec0
3 files changed
+8 -5

No files matched your search

+1 -1
View File
@@ -152,7 +152,7 @@ class UiConstantsHandler extends ResourceHandler {
class LanguageHandler extends ResourceHandler {
async all({ lang }) {
if (!global.Hydro.locales[lang]) lang = SystemModel.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][Symbol.for('iterate')])};`;
this.response.type = 'application/javascript';
}
}