Issue 9992: post type hadn't been translated in the user's language

This commit is contained in:
Michael 2021-03-07 07:39:13 +00:00
parent d43c5b1dbc
commit 1940c17030
2 changed files with 9 additions and 8 deletions

View File

@ -172,7 +172,7 @@ function notification($params)
return false; return false;
} }
$item_post_type = Item::postType($item); $item_post_type = Item::postType($item, $l10n);
$content = Plaintext::getPost($item, 70); $content = Plaintext::getPost($item, 70);
if (!empty($content['text'])) { if (!empty($content['text'])) {

View File

@ -2475,22 +2475,23 @@ class Item
/** /**
* get translated item type * get translated item type
* *
* @param $item * @param array $item
* @param \Friendica\Core\L10n $l10n
* @return string * @return string
*/ */
public static function postType($item) public static function postType(array $item, \Friendica\Core\L10n $l10n)
{ {
if (!empty($item['event-id'])) { if (!empty($item['event-id'])) {
return DI::l10n()->t('event'); return $l10n->t('event');
} elseif (!empty($item['resource-id'])) { } elseif (!empty($item['resource-id'])) {
return DI::l10n()->t('photo'); return $l10n->t('photo');
} elseif ($item['gravity'] == GRAVITY_ACTIVITY) { } elseif ($item['gravity'] == GRAVITY_ACTIVITY) {
return DI::l10n()->t('activity'); return $l10n->t('activity');
} elseif ($item['gravity'] == GRAVITY_COMMENT) { } elseif ($item['gravity'] == GRAVITY_COMMENT) {
return DI::l10n()->t('comment'); return $l10n->t('comment');
} }
return DI::l10n()->t('post'); return $l10n->t('post');
} }
/** /**