Fix smarty_function_markdown_to_text() to use $locale
This commit is contained in:
parent
1f05d88c42
commit
e7947354ac
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue