mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
_t function parameter documentation fix
This corrects the parameter documentation for the _t function. The docs for the fourth parameter is now declared as an array. This does not break backwards compatibility. As discussed in #7018
This commit is contained in:
parent
c66a5ebcd2
commit
344c534133
@ -2027,13 +2027,14 @@ class i18n extends Object implements TemplateGlobalProvider, Flushable {
|
|||||||
* reusing a string which has already been "declared" (using another call to this function,
|
* reusing a string which has already been "declared" (using another call to this function,
|
||||||
* with the same class and entity), you can omit it.
|
* with the same class and entity), you can omit it.
|
||||||
* @param string $context (optional) If the string can be difficult to translate by any reason, you can help
|
* @param string $context (optional) If the string can be difficult to translate by any reason, you can help
|
||||||
* translators with some more info using this param
|
* translators with some more info using this param
|
||||||
* @param string injectionArray (optional) array of key value pairs that are used to replace corresponding
|
* @param array $injection (optional) array of key value pairs that are used to replace corresponding
|
||||||
* expressions in {curly brackets} in the $string. The injection array can also be
|
* expressions in {curly brackets} in the $string. The injection array can also be
|
||||||
* used as the their argument to the _t() function
|
* used as the their argument to the _t() function. The injection array can be the second,
|
||||||
|
* third or fourth parameter. The function will use the first parameter that is an array
|
||||||
* @return string The translated string, according to the currently set locale {@link i18n::set_locale()}
|
* @return string The translated string, according to the currently set locale {@link i18n::set_locale()}
|
||||||
*/
|
*/
|
||||||
public static function _t($entity, $string = "", $context = "", $injection = "") {
|
public static function _t($entity, $string = "", $context = "", $injection = array()) {
|
||||||
if(is_numeric($context) && in_array($context, array(PR_LOW, PR_MEDIUM, PR_HIGH))) {
|
if(is_numeric($context) && in_array($context, array(PR_LOW, PR_MEDIUM, PR_HIGH))) {
|
||||||
Deprecation::notice(
|
Deprecation::notice(
|
||||||
'3.0',
|
'3.0',
|
||||||
|
Loading…
Reference in New Issue
Block a user