Documentation

I18nDto
in package

FinalYes
Tags
author

Javier Eguiluz javier.eguiluz@gmail.com

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

$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
see
self::getLocale()

if you need to format locale for Symfony code

Return values
string

getLanguage()

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
string

getLocale()

Returns the full locale formatted as ICU/Java/Symfony locales (e.g. 'es_ES', 'en_US').

public getLocale() : string
Tags
see
self::getHtmlLocale()

if you need to format locale for HTML 'lang' attribute

Return values
string

getTextDirection()

public getTextDirection() : string
Return values
string

getTranslationDomain()

public getTranslationDomain() : string
Return values
string

getTranslationParameters()

public getTranslationParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results