final class FileTranslator implements TranslatorInterface (View source)

Resolves source catalogs and runtime overrides with the configured locale fallback

Methods

__construct(ApplicationContext $context, LocalizationConfig $config, TranslationResourceRegistry|null $resources = null, TranslationSourceCatalogInterface|null $sources = null, TranslationOverrideProviderInterface|null $overrides = null)

Configures locale settings, source resources and the optional mutable override provider

string|null
locale()
string|null
string
get(string $key, array $replacements = [], string|null $locale = null)
string
array
group(string $group, string|null $locale = null)
array
array
all(string|null $locale = null)
array

Details

__construct

__construct(ApplicationContext $context, LocalizationConfig $config, TranslationResourceRegistry|null $resources = null, TranslationSourceCatalogInterface|null $sources = null, TranslationOverrideProviderInterface|null $overrides = null)

Configures locale settings, source resources and the optional mutable override provider

setLocale

TranslatorInterface setLocale(string|null $locale)

No description

Parameters

string|null $locale

Return Value

TranslatorInterface

locale

string|null locale()

No description

Return Value

string|null

get

string get(string $key, array $replacements = [], string|null $locale = null)

No description

Parameters

string $key
array $replacements
string|null $locale

Return Value

string

group

array group(string $group, string|null $locale = null)

No description

Parameters

string $group
string|null $locale

Return Value

array

all

array all(string|null $locale = null)

No description

Parameters

string|null $locale

Return Value

array