From f43e7a9405cbc0d469d29060f7f37a6eb0055988 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 26 Apr 2017 09:27:41 +0200 Subject: [PATCH 1/3] Fix past tense Signed-off-by: Joas Schilling --- apps/sharebymail/lib/Activity.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/sharebymail/lib/Activity.php b/apps/sharebymail/lib/Activity.php index 6dc462bf492..73751cb241e 100644 --- a/apps/sharebymail/lib/Activity.php +++ b/apps/sharebymail/lib/Activity.php @@ -173,17 +173,17 @@ class Activity implements IProvider { ->setRichSubject($this->l->t('{actor} shared {file} with {email} by mail'), $parsedParameters) ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg'))); } else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND) { - $event->setParsedSubject($this->l->t('Password to access %1$s was send to %2s', [ + $event->setParsedSubject($this->l->t('Password to access %1$s was sent to %2s', [ $parsedParameters['file']['path'], $parsedParameters['email']['name'] ])) - ->setRichSubject($this->l->t('Password to access {file} was send to {email}'), $parsedParameters) + ->setRichSubject($this->l->t('Password to access {file} was sent to {email}'), $parsedParameters) ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg'))); } else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND_SELF) { $event->setParsedSubject( - $this->l->t('Password to access %1$s was send to you', + $this->l->t('Password to access %1$s was sent to you', [$parsedParameters['file']['path']])) - ->setRichSubject($this->l->t('Password to access {file} was send to you'), $parsedParameters) + ->setRichSubject($this->l->t('Password to access {file} was sent to you'), $parsedParameters) ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg'))); } else { From 6c28c4ac8be4f296696d820798982d9a28f952c1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 26 Apr 2017 09:27:55 +0200 Subject: [PATCH 2/3] Use correct plural form and add special strings for tomorrow and today Signed-off-by: Joas Schilling --- apps/user_ldap/lib/Notification/Notifier.php | 14 +++++++++++++- apps/user_ldap/lib/User/User.php | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/user_ldap/lib/Notification/Notifier.php b/apps/user_ldap/lib/Notification/Notifier.php index a6053cfcb19..0099d764f03 100644 --- a/apps/user_ldap/lib/Notification/Notifier.php +++ b/apps/user_ldap/lib/Notification/Notifier.php @@ -60,7 +60,19 @@ class Notifier implements INotifier { switch ($notification->getSubject()) { // Deal with known subjects case 'pwd_exp_warn_days': - $notification->setParsedSubject($l->t('Your password will expire within %s day(s).', $notification->getSubjectParameters())); + $params = $notification->getSubjectParameters(); + $days = (int) $params[0]; + if ($days === 2) { + $notification->setParsedSubject($l->t('Your password will expire tomorrow.', $days)); + } else if ($days === 1) { + $notification->setParsedSubject($l->t('Your password will expire today.', $days)); + } else { + $notification->setParsedSubject($l->n( + 'Your password will expire within %n day.', + 'Your password will expire within %n days.', + $days + )); + } return $notification; default: diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php index a9e7eb6cc0c..5017f35ed0a 100644 --- a/apps/user_ldap/lib/User/User.php +++ b/apps/user_ldap/lib/User/User.php @@ -683,7 +683,7 @@ class User { ->setUser($uid) ->setDateTime($currentDateTime) ->setObject('pwd_exp_warn', $uid) - ->setSubject('pwd_exp_warn_days', [strval(ceil($secondsToExpiry / 60 / 60 / 24))]) + ->setSubject('pwd_exp_warn_days', [(int) ceil($secondsToExpiry / 60 / 60 / 24)]) ; $this->notificationManager->notify($notification); } From ec323cb687891cc877404f51b2ac19ae8f7bc151 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 26 Apr 2017 09:33:18 +0200 Subject: [PATCH 3/3] Fix email vs mail Signed-off-by: Joas Schilling --- settings/Controller/MailSettingsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/Controller/MailSettingsController.php b/settings/Controller/MailSettingsController.php index df13b46b13c..de10c077ede 100644 --- a/settings/Controller/MailSettingsController.php +++ b/settings/Controller/MailSettingsController.php @@ -160,7 +160,7 @@ class MailSettingsController extends Controller { $message->setPlainBody($template->renderText()); $errors = $this->mailer->send($message); if (!empty($errors)) { - throw new \RuntimeException($this->l10n->t('Mail could not be sent. Check your mail server log')); + throw new \RuntimeException($this->l10n->t('Email could not be sent. Check your mail server log')); } return new DataResponse(); } catch (\Exception $e) {