[COMPONENT][Notification] Use _m() in reason

This commit is contained in:
Diogo Peralta Cordeiro 2021-12-28 16:36:52 +00:00
parent 3e83387e98
commit 9cda64f275
No known key found for this signature in database
GPG Key ID: 18D2D35001FBFAB0
5 changed files with 7 additions and 7 deletions

View File

@ -281,7 +281,7 @@ class Posting extends Component
}
DB::flush();
Event::handle('NewNotification', [$actor, $activity, ['object' => $mentioned], "{$actor->getNickname()} created note {$note->getUrl()}"]);
Event::handle('NewNotification', [$actor, $activity, ['object' => $mentioned], _m('{nickname} created a note {note_id}.', ['nickname' => $actor->getNickname(), 'note_id' => $activity->getObjectId()])]);
return $note;
}

View File

@ -165,7 +165,7 @@ class Inbox extends Controller
$ap_actor->getActorId(),
Discovery::normalize($actor->getNickname() . '@' . parse_url($ap_actor->getInboxUri(), PHP_URL_HOST)),
);
Event::handle('NewNotification', [$actor, $ap_act->getActivity(), [], "{$actor->getNickname()} mentioned you in a note"]);
Event::handle('NewNotification', [$actor, $ap_act->getActivity(), [], _m('{nickname} mentioned you.', ['nickname' => $actor->getNickname()])]);
DB::flush();
dd($ap_act, $act = $ap_act->getActivity(), $act->getActor(), $act->getObject());

View File

@ -60,7 +60,7 @@ class DeleteNote extends NoteHandlerPlugin
$activity = $note->delete(actor: $actor, source: 'web');
// Undertaker successful
Event::handle('NewNotification', [$actor, $activity, [], "{$actor->getNickname()} deleted note {$activity->getObjectId()}"]);
Event::handle('NewNotification', [$actor, $activity, [], _m('{nickname} deleted note {note_id}.', ['nickname' => $actor->getNickname(), 'note_id' => $activity->getObjectId()])]);
return $activity;
}

View File

@ -58,7 +58,7 @@ class Favourite extends NoteHandlerPlugin
]);
DB::persist($activity);
Event::handle('NewNotification', [$actor = Actor::getById($actor_id), $activity, [], "{$actor->getNickname()} favoured note {$note_id}"]);
Event::handle('NewNotification', [$actor = Actor::getById($actor_id), $activity, [], _m('{nickname} favoured note {note_id}.', ['nickname' => $actor->getNickname(), 'note_id' => $activity->getObjectId()])]);
}
return $activity;
}
@ -79,7 +79,7 @@ class Favourite extends NoteHandlerPlugin
]);
DB::persist($activity);
Event::handle('NewNotification', [$actor = Actor::getById($actor_id), $activity, [], "{$actor->getNickname()} unfavoured note {$note_id}"]);
Event::handle('NewNotification', [$actor = Actor::getById($actor_id), $activity, [], _m('{nickname} unfavoured note {note_id}.', ['nickname' => $actor->getNickname(), 'note_id' => $activity->getObjectId()])]);
}
return $activity;
}

View File

@ -85,7 +85,7 @@ class RepeatNote extends NoteHandlerPlugin
]);
DB::persist($repeat_activity);
Event::handle('NewNotification', [$actor = Actor::getById($actor_id), $repeat_activity, [], "{$actor->getNickname()} repeated note {$note->getUrl()}"]);
Event::handle('NewNotification', [$actor = Actor::getById($actor_id), $repeat_activity, [], _m('{nickname} repeated note {note_id}.', ['nickname' => $actor->getNickname(), 'note_id' => $repeat_activity->getObjectId()])]);
return $repeat_activity;
}
@ -119,7 +119,7 @@ class RepeatNote extends NoteHandlerPlugin
]);
DB::persist($undo_repeat_activity);
Event::handle('NewNotification', [$actor = Actor::getById($actor_id), $undo_repeat_activity, [], "{$actor->getNickname()} unrepeated note {$note_id}"]);
Event::handle('NewNotification', [$actor = Actor::getById($actor_id), $undo_repeat_activity, [], _m('{nickname} unrepeated note {note_id}.', ['nickname' => $actor->getNickname(), 'note_id' => $note_id])]);
return $undo_repeat_activity;
} else {