ソースを参照

Relax what t accepts so we don't break it all

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
tags/v14.0.0beta1
Roeland Jago Douma 6年前
コミット
a423860f42
コミッターのメールアドレスに関連付けられたアカウントが存在しません
2個のファイルの変更8行の追加4行の削除
  1. 6
    2
      lib/private/L10N/L10N.php
  2. 2
    2
      lib/public/IL10N.php

+ 6
- 2
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);
}


+ 2
- 2
lib/public/IL10N.php ファイルの表示

@@ -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

読み込み中…
キャンセル
保存