IL10N
in
Interface IL10N
Tags
Table of Contents
Methods
- getLanguageCode() : string
- The code (en, de, ...) of the language that is used for this IL10N object
- getLocaleCode() : string
- * The code (en_US, fr_CA, ...) of the locale that is used for this IL10N object
- l() : string|int|false
- Localization
- n() : string
- Translating
- t() : string
- Translating
Methods
getLanguageCode()
The code (en, de, ...) of the language that is used for this IL10N object
public
getLanguageCode() : string
Tags
Return values
string —language
getLocaleCode()
* The code (en_US, fr_CA, ...) of the locale that is used for this IL10N object
public
getLocaleCode() : string
Tags
Return values
string —locale
l()
Localization
public
l(string $type, DateTime|int|string $data[, array<string|int, mixed> $options = [] ]) : string|int|false
Parameters
- $type : string
-
Type of localization
- $data : DateTime|int|string
-
parameters for this localization
- $options : array<string|int, mixed> = []
-
currently supports following options:
- 'width': handed into \Punic\Calendar::formatDate as second parameter
Tags
Return values
string|int|false —Returns the localized data.
Implemented types:
- date
- Creates a date
- l10n-field: date
- params: timestamp (int/string)
- datetime
- Creates date and time
- l10n-field: datetime
- params: timestamp (int/string)
- time
- Creates a time
- l10n-field: time
- params: timestamp (int/string)
n()
Translating
public
n(string $text_singular, string $text_plural, int $count[, array<string|int, mixed> $parameters = [] ]) : string
Parameters
- $text_singular : string
-
the string to translate for exactly one object
- $text_plural : string
-
the string to translate for n objects
- $count : int
-
Number of objects
- $parameters : array<string|int, mixed> = []
-
default:array() Parameters for sprintf
Tags
Return values
string —Translation or the same text
Returns the translation. If no translation is found, $text will be returned. %n will be replaced with the number of objects.
The correct plural is determined by the plural_forms-function provided by the po file.
t()
Translating
public
t(string $text[, array<string|int, mixed>|string $parameters = [] ]) : string
Parameters
- $text : string
-
The text we need a translation for
- $parameters : array<string|int, mixed>|string = []
-
default:array() Parameters for sprintf
Tags
Return values
string —Translation or the same text
Returns the translation. If no translation is found, $text will be returned.