i18n functions

__($message, $default = null)

Retrieves a translation from the last loaded dictionary.

Parameters:
  • $message (string) – The message to translate.
  • $default (string) – The default text to return when the message is not found. Default value is the message itself.
Returns:

The translation or null if not founded

n__($singular, $plural, $n = false)

The plural version of __. Some languages have more than one form for plural messages dependent on the count.

Parameters:
  • $singular (string) – The singular form of the string to be converted. Used as the key for the search in the dictionary
  • $plural (string) – The plural form
  • $n (string) – Used to determine which plural form to used depending locale.
Returns:

The translation or, if not founded, $singular is returned if n == 1, otherwise $plural
If third parameter is ommited and translation founded, return an array of singular and plural forms

___($group, $message, $default = null)

Retrieves a translation from a specific dictionary.

Parameters:
  • $group (string) – Which dictionary to look into.
  • $message (string) – The message to translate.
  • $default (string) – The default text to return when the message is not found. Default value is the message itself.
Returns:

The translation or null if not founded