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

+5 -2
View File
@@ -62,8 +62,11 @@ global.Hydro.locales = new Proxy(translations, {
get(self, lang: string) {
if (!self[lang]) return {};
return new Proxy(self[lang], {
get(s, key: string) {
return app.i18n.get(key, lang);
get(s, key) {
if (typeof key === 'string') return app.i18n.get(key, lang);
const result = {};
for (let i = s.length - 1; i; i--) Object.assign(result, s[i]);
return result;
},
});
},