Provide the ability to localize notifications

This commit is contained in:
2025-02-16 22:59:44 +08:00
parent 50ff8304e4
commit 5fb769823a
13 changed files with 205 additions and 309 deletions

View File

@@ -17,6 +17,8 @@ func AddProvider(in NotificationProvider) {
}
func PushNotification(in pushkit.NotificationPushRequest) error {
in.Notification = TranslateNotify(in.Notification, in.Lang)
requestId := uuid.NewString()
log.Debug().
Str("tk", in.Token).
@@ -77,10 +79,11 @@ func PushNotificationBatch(in pushkit.NotificationPushBatchRequest) {
Msg("Provider was not found, push skipped...")
continue
}
wg.Add(1)
go func() {
wg.Add(1)
defer wg.Done()
in.Notification = TranslateNotify(in.Notification, in.Lang[idx])
log.Debug().
Str("tk", in.Tokens[0]).
Str("provider", in.Providers[0]).