Documentation

DataCollectorTranslator
in package
implements TranslatorInterface, TranslatorBagInterface, LocaleAwareInterface, WarmableInterface

Tags
author

Abdellatif Ait boudad a.aitboudad@gmail.com

Table of Contents

Interfaces

TranslatorInterface
TranslatorBagInterface
LocaleAwareInterface
WarmableInterface
Interface for classes that support warming their cache.

Constants

MESSAGE_DEFINED  = 0
MESSAGE_EQUALS_FALLBACK  = 2
MESSAGE_MISSING  = 1

Properties

$messages  : array<string|int, mixed>
$translator  : mixed

Methods

__call()  : mixed
Passes through all unknown calls onto the translator object.
__construct()  : mixed
getCatalogue()  : MessageCatalogueInterface
Gets the catalogue by locale.
getCatalogues()  : array<string|int, MessageCatalogueInterface>
Returns all catalogues of the instance.
getCollectedMessages()  : array<string|int, mixed>
getFallbackLocales()  : array<string|int, mixed>
Gets the fallback locales.
getLocale()  : string
Returns the default locale.
setLocale()  : mixed
Sets the current locale.
trans()  : string
Translates the given message.
warmUp()  : array<string|int, string>
Warms up the cache.
collectMessage()  : mixed

Constants

Properties

Methods

__call()

Passes through all unknown calls onto the translator object.

public __call(string $method, array<string|int, mixed> $args) : mixed
Parameters
$method : string
$args : array<string|int, mixed>

getCollectedMessages()

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

getFallbackLocales()

Gets the fallback locales.

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

setLocale()

Sets the current locale.

public setLocale(string $locale) : mixed
Parameters
$locale : string

trans()

Translates the given message.

public trans(string|null $id[, array<string|int, mixed> $parameters = [] ][, string $domain = null ][, string $locale = null ]) : string
Parameters
$id : string|null

The message id (may also be an object that can be cast to string)

$parameters : array<string|int, mixed> = []

An array of parameters for the message

$domain : string = null

The domain for the message or null to use the default

$locale : string = null

The locale or null to use the default

Return values
string

warmUp()

Warms up the cache.

public warmUp(string $cacheDir) : array<string|int, string>
Parameters
$cacheDir : string
Return values
array<string|int, string>

collectMessage()

private collectMessage(string|null $locale, string|null $domain, string $id, string $translation[, array<string|int, mixed>|null $parameters = [] ]) : mixed
Parameters
$locale : string|null
$domain : string|null
$id : string
$translation : string
$parameters : array<string|int, mixed>|null = []

        
On this page

Search results