I18nDto
in package
FinalYes
Tags
Table of Contents
Properties
- $language : mixed
- $locale : string
- $textDirection : string
- $translationDomain : string
- $translationParameters : array<string|int, mixed>
Methods
- __construct() : mixed
- getHtmlLocale() : string
- Returns the locale formatted as an IETF BCP 47 language tag, as required by HTML 'lang' attribute (in practice, it replaces underscores by dashes).
- getLanguage() : string
- Returns the language part of the locale (e.g. returns 'es' for 'es_ES' and 'zh' for 'zh_Hans_MO').
- getLocale() : string
- Returns the full locale formatted as ICU/Java/Symfony locales (e.g. 'es_ES', 'en_US').
- getTextDirection() : string
- getTranslationDomain() : string
- getTranslationParameters() : array<string|int, mixed>
Properties
$language
private
mixed
$language
$locale
private
string
$locale
$textDirection
private
string
$textDirection
$translationDomain
private
string
$translationDomain
$translationParameters
private
array<string|int, mixed>
$translationParameters
Methods
__construct()
public
__construct(string $locale, string $textDirection, string $translationDomain, array<string|int, mixed> $translationParameters) : mixed
Parameters
- $locale : string
- $textDirection : string
- $translationDomain : string
- $translationParameters : array<string|int, mixed>
getHtmlLocale()
Returns the locale formatted as an IETF BCP 47 language tag, as required by HTML 'lang' attribute (in practice, it replaces underscores by dashes).
public
getHtmlLocale() : string
Example: Symfony locale = 'es_ES' HTML locale = 'es-ES'.
Tags
Return values
stringgetLanguage()
Returns the language part of the locale (e.g. returns 'es' for 'es_ES' and 'zh' for 'zh_Hans_MO').
public
getLanguage() : string
Return values
stringgetLocale()
Returns the full locale formatted as ICU/Java/Symfony locales (e.g. 'es_ES', 'en_US').
public
getLocale() : string
Tags
Return values
stringgetTextDirection()
public
getTextDirection() : string
Return values
stringgetTranslationDomain()
public
getTranslationDomain() : string
Return values
stringgetTranslationParameters()
public
getTranslationParameters() : array<string|int, mixed>