1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 03:34:04 +02:00

Merge pull request #6635 from iMattPro/ticket/17335

[ticket/17335] Fix language var issues in the extension manager
This commit is contained in:
Marc Alexander
2024-06-23 21:59:26 +02:00
committed by GitHub
5 changed files with 88 additions and 49 deletions

View File

@@ -93,6 +93,7 @@ class extension extends \Twig\Extension\AbstractExtension
new \Twig\TwigFunction('lang', array($this, 'lang')),
new \Twig\TwigFunction('lang_defined', array($this, 'lang_defined')),
new \Twig\TwigFunction('lang_js', [$this, 'lang_js']),
new \Twig\TwigFunction('lang_raw', [$this, 'lang_raw']),
new \Twig\TwigFunction('get_class', 'get_class'),
);
}
@@ -214,4 +215,16 @@ class extension extends \Twig\Extension\AbstractExtension
return twig_escape_filter($this->environment, call_user_func_array([$this, 'lang'], $args), 'js');
}
/**
* Get raw value associated with lang key
*
* @param string $key
*
* @return array|string Raw value associated with lang key
*/
public function lang_raw(string $key): array|string
{
return call_user_func_array(array($this->language, 'lang_raw'), [$key]);
}
}