vendor/cakephp/cakephp/src/I18nfunctions.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.

Functions

__()

__(string  $singular, array  $args) : string|null

Returns a translated string if one is found; Otherwise, the submitted message.

Parameters

string $singular

Text to translate.

array $args

Array with arguments or multiple arguments in function.

Returns

string|null —

The translated text, or null if invalid.

__n()

__n(string  $singular, string  $plural, integer  $count, array  $args) : string|null

Returns correct plural form of message identified by $singular and $plural for count $count.

Some languages have more than one form for plural messages dependent on the count.

Parameters

string $singular

Singular text to translate.

string $plural

Plural text.

integer $count

Count.

array $args

Array with arguments or multiple arguments in function.

Returns

string|null —

Plural form of translated string, or null if invalid.

__d()

__d(string  $domain, string  $msg, array  $args) : string|null

Allows you to override the current domain for a single message lookup.

Parameters

string $domain

Domain.

string $msg

String to translate.

array $args

Array with arguments or multiple arguments in function.

Returns

string|null —

Translated string.

__dn()

__dn(string  $domain, string  $singular, string  $plural, integer  $count, array  $args) : string|null

Allows you to override the current domain for a single plural message lookup.

Returns correct plural form of message identified by $singular and $plural for count $count from domain $domain.

Parameters

string $domain

Domain.

string $singular

Singular string to translate.

string $plural

Plural.

integer $count

Count.

array $args

Array with arguments or multiple arguments in function.

Returns

string|null —

Plural form of translated string.

__x()

__x(string  $context, string  $singular, array  $args) : string|null

Returns a translated string if one is found; Otherwise, the submitted message.

The context is a unique identifier for the translations string that makes it unique within the same domain.

Parameters

string $context

Context of the text.

string $singular

Text to translate.

array $args

Array with arguments or multiple arguments in function.

Returns

string|null —

Translated string.

__xn()

__xn(string  $context, string  $singular, string  $plural, integer  $count, array  $args) : string|null

Returns correct plural form of message identified by $singular and $plural for count $count.

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

string $context

Context of the text.

string $singular

Singular text to translate.

string $plural

Plural text.

integer $count

Count.

array $args

Array with arguments or multiple arguments in function.

Returns

string|null —

Plural form of translated string.

__dx()

__dx(string  $domain, string  $context, string  $msg, array  $args) : string|null

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

string $domain

Domain.

string $context

Context of the text.

string $msg

String to translate.

array $args

Array with arguments or multiple arguments in function.

Returns

string|null —

Translated string.

__dxn()

__dxn(string  $domain, string  $context, string  $singular, string  $plural, integer  $count, array  $args) : string|null

Returns correct plural form of message identified by $singular and $plural for count $count.

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

string $domain

Domain.

string $context

Context of the text.

string $singular

Singular text to translate.

string $plural

Plural text.

integer $count

Count.

array $args

Array with arguments or multiple arguments in function.

Returns

string|null —

Plural form of translated string.