Skip to content
Snippets Groups Projects
Unverified Commit 7144d7a1 authored by Roeland Jago Douma's avatar Roeland Jago Douma Committed by GitHub
Browse files

Merge pull request #8497 from nextcloud/relax_l10n

Relax what t accepts so we don't break it all
parents a2102475 a423860f
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
......@@ -45,14 +45,14 @@ interface 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.
* @since 6.0.0
*/
public function t(string $text, array $parameters = []): string;
public function t(string $text, $parameters = []): string;
/**
* Translating
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment