notification polishing

Signed-off-by: Sascha Wiswedel <sascha.wiswedel@nextcloud.com>
This commit is contained in:
Sascha Wiswedel 2019-12-06 14:48:00 +01:00 committed by Roeland Jago Douma
parent f1319e1bc5
commit f567566803
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 18 additions and 18 deletions

View File

@ -142,7 +142,7 @@ class Notifier implements INotifier, IDismissableNotifier {
$notification->addParsedAction($approveAction) $notification->addParsedAction($approveAction)
->addParsedAction($disapproveAction) ->addParsedAction($disapproveAction)
->setRichSubject( ->setRichSubject(
$l->t('Incoming file transfer from {user}'), $l->t('Incoming ownership transfer from {user}'),
[ [
'user' => [ 'user' => [
'type' => 'user', 'type' => 'user',
@ -150,7 +150,7 @@ class Notifier implements INotifier, IDismissableNotifier {
'name' => $param['sourceUser'], 'name' => $param['sourceUser'],
], ],
]) ])
->setParsedSubject(str_replace('{user}', $param['sourceUser'], $l->t('Incoming file transfer from {user}'))) ->setParsedSubject(str_replace('{user}', $param['sourceUser'], $l->t('Incoming ownership transfer from {user}')))
->setRichMessage( ->setRichMessage(
$l->t('Do you want to accept {path}?'), $l->t('Do you want to accept {path}?'),
[ [
@ -169,11 +169,11 @@ class Notifier implements INotifier, IDismissableNotifier {
$l = $this->l10nFactory->get('files', $languageCode); $l = $this->l10nFactory->get('files', $languageCode);
$param = $notification->getSubjectParameters(); $param = $notification->getSubjectParameters();
$notification->setRichSubject($l->t('File transfer failed')) $notification->setRichSubject($l->t('Ownership transfer failed'))
->setParsedSubject($l->t('File transfer failed')) ->setParsedSubject($l->t('Ownership transfer failed'))
->setRichMessage( ->setRichMessage(
$l->t('Your transfer of {path} to {user} failed.'), $l->t('Your ownership transfer of {path} to {user} failed.'),
[ [
'path' => [ 'path' => [
'type' => 'highlight', 'type' => 'highlight',
@ -186,7 +186,7 @@ class Notifier implements INotifier, IDismissableNotifier {
'name' => $param['targetUser'], 'name' => $param['targetUser'],
], ],
]) ])
->setParsedMessage(str_replace(['{path}', '{user}'], [$param['nodeName'], $param['targetUser']], $l->t('Your transfer of {path} to {user} failed.'))); ->setParsedMessage(str_replace(['{path}', '{user}'], [$param['nodeName'], $param['targetUser']], $l->t('Your ownership transfer of {path} to {user} failed.')));
return $notification; return $notification;
} }
@ -194,11 +194,11 @@ class Notifier implements INotifier, IDismissableNotifier {
$l = $this->l10nFactory->get('files', $languageCode); $l = $this->l10nFactory->get('files', $languageCode);
$param = $notification->getSubjectParameters(); $param = $notification->getSubjectParameters();
$notification->setRichSubject($l->t('File transfer failed')) $notification->setRichSubject($l->t('Ownership transfer failed'))
->setParsedSubject($l->t('File transfer failed')) ->setParsedSubject($l->t('Ownership transfer failed'))
->setRichMessage( ->setRichMessage(
$l->t('The transfer of {path} from {user} failed.'), $l->t('The ownership transfer of {path} from {user} failed.'),
[ [
'path' => [ 'path' => [
'type' => 'highlight', 'type' => 'highlight',
@ -211,7 +211,7 @@ class Notifier implements INotifier, IDismissableNotifier {
'name' => $param['sourceUser'], 'name' => $param['sourceUser'],
], ],
]) ])
->setParsedMessage(str_replace(['{path}', '{user}'], [$param['nodeName'], $param['sourceUser']], $l->t('The transfer of {path} from {user} failed.'))); ->setParsedMessage(str_replace(['{path}', '{user}'], [$param['nodeName'], $param['sourceUser']], $l->t('The ownership transfer of {path} from {user} failed.')));
return $notification; return $notification;
} }
@ -220,11 +220,11 @@ class Notifier implements INotifier, IDismissableNotifier {
$l = $this->l10nFactory->get('files', $languageCode); $l = $this->l10nFactory->get('files', $languageCode);
$param = $notification->getSubjectParameters(); $param = $notification->getSubjectParameters();
$notification->setRichSubject($l->t('File transfer done')) $notification->setRichSubject($l->t('Ownership transfer done'))
->setParsedSubject($l->t('File transfer done')) ->setParsedSubject($l->t('Ownership transfer done'))
->setRichMessage( ->setRichMessage(
$l->t('Your transfer of {path} to {user} has completed.'), $l->t('Your ownership transfer of {path} to {user} has completed.'),
[ [
'path' => [ 'path' => [
'type' => 'highlight', 'type' => 'highlight',
@ -237,7 +237,7 @@ class Notifier implements INotifier, IDismissableNotifier {
'name' => $param['targetUser'], 'name' => $param['targetUser'],
], ],
]) ])
->setParsedMessage(str_replace(['{path}', '{user}'], [$param['nodeName'], $param['targetUser']], $l->t('Your transfer of {path} to {user} has completed.'))); ->setParsedMessage(str_replace(['{path}', '{user}'], [$param['nodeName'], $param['targetUser']], $l->t('Your ownership transfer of {path} to {user} has completed.')));
return $notification; return $notification;
} }
@ -246,11 +246,11 @@ class Notifier implements INotifier, IDismissableNotifier {
$l = $this->l10nFactory->get('files', $languageCode); $l = $this->l10nFactory->get('files', $languageCode);
$param = $notification->getSubjectParameters(); $param = $notification->getSubjectParameters();
$notification->setRichSubject($l->t('File transfer done')) $notification->setRichSubject($l->t('Ownership transfer done'))
->setParsedSubject($l->t('File transfer done')) ->setParsedSubject($l->t('Ownership transfer done'))
->setRichMessage( ->setRichMessage(
$l->t('The transfer of {path} from {user} has completed.'), $l->t('The ownership transfer of {path} from {user} has completed.'),
[ [
'path' => [ 'path' => [
'type' => 'highlight', 'type' => 'highlight',
@ -263,7 +263,7 @@ class Notifier implements INotifier, IDismissableNotifier {
'name' => $param['sourceUser'], 'name' => $param['sourceUser'],
], ],
]) ])
->setParsedMessage(str_replace(['{path}', '{user}'], [$param['nodeName'], $param['sourceUser']], $l->t('The transfer of {path} from {user} has completed.'))); ->setParsedMessage(str_replace(['{path}', '{user}'], [$param['nodeName'], $param['sourceUser']], $l->t('The ownership transfer of {path} from {user} has completed.')));
return $notification; return $notification;
} }