class TranslatorAdapterFactory implements TranslatorAdapterFactoryInterface (View source)

The core translator adapter factory is a wrapper factory that abstracts the translator creation based on the passed locale. By default, a translator instance will be created through the LaminasTranslatorAdapterFactory.

If the passed locale is the system's base locale and if translations are NOT enabled for the base locale, a translator instance will be created through the PlainTranslatorAdapterFactory.

Properties

protected Repository $config
protected TranslatorAdapterFactory $plainFactory
protected TranslatorAdapterFactory $laminasFactory

Methods

__construct(Repository $config, TranslatorAdapterFactory $plainFactory, TranslatorAdapterFactory $laminasFactory)

No description

createTranslatorAdapter(string $locale)

Creates a translator adapter for the given locale.

shouldTranslateBaseLocale()

No description

Details

__construct(Repository $config, TranslatorAdapterFactory $plainFactory, TranslatorAdapterFactory $laminasFactory)

No description

Parameters

Repository $config
TranslatorAdapterFactory $plainFactory
TranslatorAdapterFactory $laminasFactory

TranslatorAdapterInterface createTranslatorAdapter(string $locale)

Creates a translator adapter for the given locale.

Parameters

string $locale

Return Value

TranslatorAdapterInterface

private shouldTranslateBaseLocale()

No description