Display the languages in the post

This commit is contained in:
Michael 2020-10-04 18:52:28 +00:00
parent 50a0927e7e
commit b6b28b1541
6 changed files with 33 additions and 1 deletions

View file

@ -2487,6 +2487,16 @@ class Item
return '';
}
public static function getLanguageMessage(array $item)
{
$used_languages = '';
foreach (json_decode($item['language'], true) as $language => $reliability) {
$used_languages .= $language . ": " . number_format($reliability, 5) . '\n';
}
$used_languages = DI::l10n()->t('Used languages in this post:\n%s', $used_languages);
return $used_languages;
}
/**
* Creates an unique guid out of a given uri
*