mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: i18n: better performance
This commit is contained in:
5 files changed
+10
-27
No files matched your search
@@ -80,7 +80,7 @@ class MessageModel {
|
||||
const targets = await user.getMulti({ priv: { $bitsAllSet: PRIV.PRIV_VIEW_SYSTEM_NOTIFICATION } })
|
||||
.project({ _id: 1, viewLang: 1 }).toArray();
|
||||
return Promise.all(targets.map(({ _id, viewLang }) => {
|
||||
const msg = message.translate(viewLang || system.get('server.language')).format(...args);
|
||||
const msg = app.i18n.translate(message, [viewLang || system.get('server.language')]).format(...args);
|
||||
return MessageModel.send(1, _id, msg, MessageModel.FLAG_RICHTEXT);
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user