From de81c52c807fa9942d3bec55866096ba66cfb7d6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 15 Sep 2016 14:59:54 +0200 Subject: Add support for translations of move/rename activities Signed-off-by: Joas Schilling --- apps/files/lib/Activity.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'apps/files/lib/Activity.php') diff --git a/apps/files/lib/Activity.php b/apps/files/lib/Activity.php index b9cc98cf7ea..726ec3c1fe4 100644 --- a/apps/files/lib/Activity.php +++ b/apps/files/lib/Activity.php @@ -104,7 +104,7 @@ class Activity implements IExtension { $l = $this->getL10N($languageCode); return [ self::TYPE_SHARE_CREATED => (string) $l->t('A new file or folder has been created'), - self::TYPE_SHARE_CHANGED => (string) $l->t('A file or folder has been changed'), + self::TYPE_SHARE_CHANGED => (string) $l->t('A file or folder has been changed or renamed'), self::TYPE_FAVORITES => [ 'desc' => (string) $l->t('Limit notifications about creation and changes to your favorite files (Stream only)'), 'methods' => [self::METHOD_STREAM], @@ -189,6 +189,14 @@ class Activity implements IExtension { return (string) $l->t('You restored %1$s', $params); case 'restored_by': return (string) $l->t('%2$s restored %1$s', $params); + case 'renamed_self': + return (string) $l->t('You renamed %2$s to %1$s', $params); + case 'renamed_by': + return (string) $l->t('%2$s renamed %3$s to %1$s', $params); + case 'moved_self': + return (string) $l->t('You moved %2$s to %1$s', $params); + case 'moved_by': + return (string) $l->t('%2$s moved %3$s to %1$s', $params); default: return false; @@ -209,6 +217,10 @@ class Activity implements IExtension { return (string) $l->t('Deleted by %2$s', $params); case 'restored_by': return (string) $l->t('Restored by %2$s', $params); + case 'renamed_by': + return (string) $l->t('Renamed by %2$s', $params); + case 'moved_by': + return (string) $l->t('Moved by %2$s', $params); default: return false; @@ -242,6 +254,19 @@ class Activity implements IExtension { 0 => 'file', 1 => 'username', ]; + case 'renamed_self': + case 'moved_self': + return [ + 0 => 'file', + 1 => 'file', + ]; + case 'renamed_by': + case 'moved_by': + return [ + 0 => 'file', + 1 => 'username', + 2 => 'file', + ]; } } -- cgit v1.2.3