Fr3nch13/CakePHP Utilities

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
copyright

Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

link

CakePHP(tm) Project

since
3.0.0
license

https://opensource.org/licenses/mit-license.php MIT License

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

__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
link
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#__n
Return values
string

Plural form of 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
link
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#__dn
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
link
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#__x
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
link
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#__xn
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
link
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#__dx
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
link
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#__dxn
Return values
string

Plural form of translated string.


        
On this page

Search results