diff options
Diffstat (limited to 'lib/private/L10N/L10N.php')
-rw-r--r-- | lib/private/L10N/L10N.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/L10N/L10N.php b/lib/private/L10N/L10N.php index f0e37ca1a5d..a9b1b7377aa 100644 --- a/lib/private/L10N/L10N.php +++ b/lib/private/L10N/L10N.php @@ -78,13 +78,17 @@ class L10N implements IL10N { /** * Translating * @param string $text The text we need a translation for - * @param array $parameters default:array() Parameters for sprintf + * @param array|string $parameters default:array() Parameters for sprintf * @return string Translation or the same text * * Returns the translation. If no translation is found, $text will be * returned. */ - public function t(string $text, array $parameters = []): string { + public function t(string $text, $parameters = []): string { + if (!\is_array($parameters)) { + $parameters = [$parameters]; + } + return (string) new L10NString($this, $text, $parameters); } |