diff options
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/activity.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/apps/files/lib/activity.php b/apps/files/lib/activity.php index bf80d0cfd7c..f3bbff48640 100644 --- a/apps/files/lib/activity.php +++ b/apps/files/lib/activity.php @@ -145,6 +145,24 @@ class Activity implements IExtension { } $l = $this->getL10N($languageCode); + + if ($this->activityManager->isFormattingFilteredObject()) { + $translation = $this->translateShort($text, $l, $params); + if ($translation !== false) { + return $translation; + } + } + + return $this->translateLong($text, $l, $params); + } + + /** + * @param string $text + * @param IL10N $l + * @param array $params + * @return bool|string + */ + protected function translateLong($text, IL10N $l, array $params) { switch ($text) { case 'created_self': return (string) $l->t('You created %1$s', $params); @@ -171,6 +189,26 @@ class Activity implements IExtension { } /** + * @param string $text + * @param IL10N $l + * @param array $params + * @return bool|string + */ + protected function translateShort($text, IL10N $l, array $params) { + switch ($text) { + case 'changed_by': + return (string) $l->t('Changed by %2$s', $params); + case 'deleted_by': + return (string) $l->t('Deleted by %2$s', $params); + case 'restored_by': + return (string) $l->t('Restored by %2$s', $params); + + default: + return false; + } + } + + /** * The extension can define the type of parameters for translation * * Currently known types are: |