summaryrefslogtreecommitdiffstats
path: root/lib/private/L10N/L10N.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-02-22 12:37:29 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-02-22 12:37:29 +0100
commita423860f42a4466e7beb71efea4f132320525716 (patch)
treeb33f252db0f7589111a4e8e0d54fc2e4a399edfe /lib/private/L10N/L10N.php
parentc2c2c06546801d956778f5ab87e9042d45b40dc4 (diff)
downloadnextcloud-server-a423860f42a4466e7beb71efea4f132320525716.tar.gz
nextcloud-server-a423860f42a4466e7beb71efea4f132320525716.zip
Relax what t accepts so we don't break it all
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/L10N/L10N.php')
-rw-r--r--lib/private/L10N/L10N.php8
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);
}