Lint
This commit is contained in:
parent
d38b1cd9aa
commit
8d15fbdda2
9 changed files with 25 additions and 21 deletions
|
@ -142,11 +142,11 @@ class LocaleManager
|
|||
* Smarty "t" block.
|
||||
*
|
||||
* @param mixed[] $params Block parameters
|
||||
* @param string $text Block content
|
||||
* @param string|null $text Block content
|
||||
*
|
||||
* @return string Translated string
|
||||
*/
|
||||
public function smartyTranslate(array $params, $text)
|
||||
public function smartyTranslate(array $params, string $text = null)
|
||||
{
|
||||
if (isset($params['params'])) {
|
||||
return $this->t($text, $params['params']);
|
||||
|
@ -158,14 +158,18 @@ class LocaleManager
|
|||
/**
|
||||
* Translate a string.
|
||||
*
|
||||
* @param string $string String to translate
|
||||
* @param string|null $string $string String to translate
|
||||
*
|
||||
* @param mixed[] $params
|
||||
* @return string Translated string
|
||||
*/
|
||||
public function t($string, array $params = [])
|
||||
public function t(string $string = null, array $params = [])
|
||||
{
|
||||
return $this->translator->trans($string, $params);
|
||||
if (isset($string)) {
|
||||
return $this->translator->trans($string, $params);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue