CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 4.6 Strawberry API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 4.6
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
    • Database
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Namespace I18n

Namespaces

  • Cake\I18n\Exception
  • Cake\I18n\Formatter
  • Cake\I18n\Middleware
  • Cake\I18n\Parser

Function Detail

__() ¶

__(string $singular, mixed ...$args): string

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

Parameters
string $singular

Text to translate.

mixed ...$args

Array with arguments or multiple arguments in function.

Returns
string
Links
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#__

__d() ¶

__d(string $domain, string $msg, mixed ...$args): string

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

Parameters
string $domain

Domain.

string $msg

String to translate.

mixed ...$args

Array with arguments or multiple arguments in function.

Returns
string
Links
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#__d

__dn() ¶

__dn(string $domain, string $singular, string $plural, int $count, mixed ...$args): string

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.

int $count

Count.

mixed ...$args

Array with arguments or multiple arguments in function.

Returns
string
Links
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#__dn

__dx() ¶

__dx(string $domain, string $context, string $msg, 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
string $domain

Domain.

string $context

Context of the text.

string $msg

String to translate.

mixed ...$args

Array with arguments or multiple arguments in function.

Returns
string
Links
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#__dx

__dxn() ¶

__dxn(string $domain, string $context, string $singular, string $plural, int $count, mixed ...$args): string

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.

int $count

Count.

mixed ...$args

Array with arguments or multiple arguments in function.

Returns
string
Links
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#__dxn

__n() ¶

__n(string $singular, string $plural, int $count, mixed ...$args): string

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.

int $count

Count.

mixed ...$args

Array with arguments or multiple arguments in function.

Returns
string
Links
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#__n

__x() ¶

__x(string $context, string $singular, mixed ...$args): string

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.

mixed ...$args

Array with arguments or multiple arguments in function.

Returns
string
Links
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#__x

__xn() ¶

__xn(string $context, string $singular, string $plural, int $count, mixed ...$args): string

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.

int $count

Count.

mixed ...$args

Array with arguments or multiple arguments in function.

Returns
string
Links
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#__xn

Interfaces

  • FormatterInterface

    Formatter Interface

  • I18nDateTimeInterface

    Interface for date formatting methods shared by both Time & Date.

Classes

  • ChainMessagesLoader

    Wraps multiple message loaders calling them one after another until one of them returns a non-empty package.

  • Date

    Extends the Date class provided by Chronos.

  • FormatterLocator

    A ServiceLocator implementation for loading and retaining formatter objects.

  • FrozenDate

    Extends the Date class provided by Chronos.

  • FrozenTime

    Extends the built-in DateTime class to provide handy methods and locale-aware formatting helpers

  • I18n

    I18n handles translation of Text and time format strings.

  • MessagesFileLoader

    A generic translations package factory that will load translations files based on the file extension and the package name.

  • Number

    Number helper library.

  • Package

    Message Catalog

  • PackageLocator

    A ServiceLocator implementation for loading and retaining package objects.

  • PluralRules

    Utility class used to determine the plural number to be used for a variable base on the locale.

  • RelativeTimeFormatter

    Helper class for formatting relative dates & times.

  • Time

    Extends the built-in DateTime class to provide handy methods and locale-aware formatting helpers

  • Translator

    Translator to translate the message.

  • TranslatorRegistry

    Constructs and stores instances of translators that can be retrieved by name and locale.

OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs