Fix smarty_function_markdown_to_text() to use $locale

This commit is contained in:
Nicolas Bouilleaud 2019-04-18 16:34:04 +02:00
parent 1f05d88c42
commit e7947354ac
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ function smarty_modifier_html($html) {
*/
function smarty_function_markdown_to_text($options, Smarty_Internal_Template $template)
{
$locale = \o80\i18n\I18N::instance()->getLoadedLang();
global $locale;
$text = strip_tags(Parsedown::instance()->text($options['markdown']));
$number_letters = (new NumberFormatter($locale, NumberFormatter::ORDINAL))->format($options['id'] + 1);
return $text !== '' ? $text : __f('Poll results', '%s option', $number_letters);