]> git.mxchange.org Git - friendica.git/commitdiff
Issue 9992: post type hadn't been translated in the user's language
authorMichael <heluecht@pirati.ca>
Sun, 7 Mar 2021 07:39:13 +0000 (07:39 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 7 Mar 2021 07:39:13 +0000 (07:39 +0000)
include/enotify.php
src/Model/Item.php

index e56b563e3e5c60c3843864b09570cb80532d4e1c..4180c72e981b66a7fe7d68d163bac4c6c22cdbd8 100644 (file)
@@ -172,7 +172,7 @@ function notification($params)
                        return false;
                }
 
-               $item_post_type = Item::postType($item);
+               $item_post_type = Item::postType($item, $l10n);
 
                $content = Plaintext::getPost($item, 70);
                if (!empty($content['text'])) {
index 6d55fd56658b53d3c795243eeefb8ca368453204..31571e64880429be91f34ca1003d1390041930dc 100644 (file)
@@ -2475,22 +2475,23 @@ class Item
        /**
         * get translated item type
         *
-        * @param $item
+        * @param array                $item
+        * @param \Friendica\Core\L10n $l10n
         * @return string
         */
-       public static function postType($item)
+       public static function postType(array $item, \Friendica\Core\L10n $l10n)
        {
                if (!empty($item['event-id'])) {
-                       return DI::l10n()->t('event');
+                       return $l10n->t('event');
                } elseif (!empty($item['resource-id'])) {
-                       return DI::l10n()->t('photo');
+                       return $l10n->t('photo');
                } elseif ($item['gravity'] == GRAVITY_ACTIVITY) {
-                       return DI::l10n()->t('activity');
+                       return $l10n->t('activity');
                } elseif ($item['gravity'] == GRAVITY_COMMENT) {
-                       return DI::l10n()->t('comment');
+                       return $l10n->t('comment');
                }
 
-               return DI::l10n()->t('post');
+               return $l10n->t('post');
        }
 
        /**