Documentation

LoggingTranslator
in package
implements TranslatorInterface, TranslatorBagInterface, LocaleAwareInterface

Tags
author

Abdellatif Ait boudad a.aitboudad@gmail.com

Table of Contents

Interfaces

TranslatorInterface
TranslatorBagInterface
LocaleAwareInterface

Properties

$logger  : 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.
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.
log()  : mixed
Logs for missing translations.

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>

getFallbackLocales()

Gets the fallback locales.

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

getLocale()

Returns the default locale.

public getLocale() : string
Return values
string

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

log()

Logs for missing translations.

private log(string $id, string|null $domain, string|null $locale) : mixed
Parameters
$id : string
$domain : string|null
$locale : string|null

        
On this page

Search results