Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix missing placeholders in translations
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen authored and backportbot[bot] committed Aug 4, 2020
commit 8d56d0be55a0d268ef32b156abede6d7341a25b8
18 changes: 11 additions & 7 deletions apps/federatedfilesharing/lib/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ public function prepare(INotification $notification, string $languageCode): INot

$params = $notification->getSubjectParameters();
if ($params[0] !== $params[1] && $params[1] !== null) {
$remoteInitiator = $this->createRemoteUser($params[0]);
$remoteOwner = $this->createRemoteUser($params[1]);
$params[3] = $remoteInitiator['name'] . '@' . $remoteInitiator['server'];
$params[4] = $remoteOwner['name'] . '@' . $remoteOwner['server'];

$notification->setParsedSubject(
$l->t('You received "%3$s" as a remote share from %4$s (%1$s) (on behalf of %5$s (%2$s))', $params)
);

$initiator = $params[0];
$owner = $params[1];

$notification->setRichSubject(
$l->t('You received {share} as a remote share from {user} (on behalf of {behalf})'),
[
Expand All @@ -117,16 +119,18 @@ public function prepare(INotification $notification, string $languageCode): INot
'id' => $notification->getObjectId(),
'name' => $params[2],
],
'user' => $this->createRemoteUser($initiator),
'behalf' => $this->createRemoteUser($owner),
'user' => $remoteInitiator,
'behalf' => $remoteOwner,
]
);
} else {
$remoteOwner = $this->createRemoteUser($params[0]);
$params[3] = $remoteOwner['name'] . '@' . $remoteOwner['server'];

$notification->setParsedSubject(
$l->t('You received "%3$s" as a remote share from %4$s (%1$s)', $params)
);

$owner = $params[0];

$notification->setRichSubject(
$l->t('You received {share} as a remote share from {user}'),
Expand All @@ -136,7 +140,7 @@ public function prepare(INotification $notification, string $languageCode): INot
'id' => $notification->getObjectId(),
'name' => $params[2],
],
'user' => $this->createRemoteUser($owner),
'user' => $remoteOwner,
]
);
}
Expand Down