functions.php
CakePHP(tm) : Rapid Development Framework (https://cakephp.org) Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
Licensed under The MIT License For full copyright and license information, please see the LICENSE.txt Redistributions of files must retain the above copyright notice.
Tags
Table of Contents
Functions
- __() : string
- Returns a translated string if one is found; Otherwise, the submitted message.
- __n() : string
- Returns correct plural form of message identified by $singular and $plural for count $count.
- __d() : string
- Allows you to override the current domain for a single message lookup.
- __dn() : string
- Allows you to override the current domain for a single plural message lookup.
- __x() : string
- Returns a translated string if one is found; Otherwise, the submitted message.
- __xn() : string
- Returns correct plural form of message identified by $singular and $plural for count $count.
- __dx() : string
- Allows you to override the current domain for a single message lookup.
- __dxn() : string
- Returns correct plural form of message identified by $singular and $plural for count $count.
Functions
__()
Returns a translated string if one is found; Otherwise, the submitted message.
__(string $singular, mixed ...$args) : string
Parameters
- $singular : string
-
Text to translate.
- $args : mixed
-
Array with arguments or multiple arguments in function.
Tags
Return values
string —The translated text.
__n()
Returns correct plural form of message identified by $singular and $plural for count $count.
__n(string $singular, string $plural, int $count, mixed ...$args) : string
Some languages have more than one form for plural messages dependent on the count.
Parameters
- $singular : string
-
Singular text to translate.
- $plural : string
-
Plural text.
- $count : int
-
Count.
- $args : mixed
-
Array with arguments or multiple arguments in function.
Tags
Return values
string —Plural form of translated string.
__d()
Allows you to override the current domain for a single message lookup.
__d(string $domain, string $msg, mixed ...$args) : string
Parameters
- $domain : string
-
Domain.
- $msg : string
-
String to translate.
- $args : mixed
-
Array with arguments or multiple arguments in function.
Tags
Return values
string —Translated string.
__dn()
Allows you to override the current domain for a single plural message lookup.
__dn(string $domain, string $singular, string $plural, int $count, mixed ...$args) : string
Returns correct plural form of message identified by $singular and $plural for count $count from domain $domain.
Parameters
- $domain : string
-
Domain.
- $singular : string
-
Singular string to translate.
- $plural : string
-
Plural.
- $count : int
-
Count.
- $args : mixed
-
Array with arguments or multiple arguments in function.
Tags
Return values
string —Plural form of translated string.
__x()
Returns a translated string if one is found; Otherwise, the submitted message.
__x(string $context, string $singular, mixed ...$args) : string
The context is a unique identifier for the translations string that makes it unique within the same domain.
Parameters
- $context : string
-
Context of the text.
- $singular : string
-
Text to translate.
- $args : mixed
-
Array with arguments or multiple arguments in function.
Tags
Return values
string —Translated string.
__xn()
Returns correct plural form of message identified by $singular and $plural for count $count.
__xn(string $context, string $singular, string $plural, int $count, mixed ...$args) : string
Some languages have more than one form for plural messages dependent on the count. The context is a unique identifier for the translations string that makes it unique within the same domain.
Parameters
- $context : string
-
Context of the text.
- $singular : string
-
Singular text to translate.
- $plural : string
-
Plural text.
- $count : int
-
Count.
- $args : mixed
-
Array with arguments or multiple arguments in function.
Tags
Return values
string —Plural form of translated string.
__dx()
Allows you to override the current domain for a single message lookup.
__dx(string $domain, string $context, string $msg, mixed ...$args) : string
The context is a unique identifier for the translations string that makes it unique within the same domain.
Parameters
- $domain : string
-
Domain.
- $context : string
-
Context of the text.
- $msg : string
-
String to translate.
- $args : mixed
-
Array with arguments or multiple arguments in function.
Tags
Return values
string —Translated string.
__dxn()
Returns correct plural form of message identified by $singular and $plural for count $count.
__dxn(string $domain, string $context, string $singular, string $plural, int $count, mixed ...$args) : string
Allows you to override the current domain for a single message lookup. The context is a unique identifier for the translations string that makes it unique within the same domain.
Parameters
- $domain : string
-
Domain.
- $context : string
-
Context of the text.
- $singular : string
-
Singular text to translate.
- $plural : string
-
Plural text.
- $count : int
-
Count.
- $args : mixed
-
Array with arguments or multiple arguments in function.
Tags
Return values
string —Plural form of translated string.