class PackagesTranslationLoader extends AbstractTranslationLoader (View source)

Translation loader that loads the package translations for the Zend translation adapter.

Properties

protected $app from AbstractTranslationLoader

Methods

loadTranslations(TranslatorAdapterInterface $translatorAdapter)

Loads the translations from this loader type into the given translator instance.

string[]
getLocaleIDAlternatives(string $localeID)

Get the locale identifier alternatives (eg: 'en_US' gives ['en_US', 'en']).

string|null
locateLanguageFile(Package $package, string $localeID)

Get the full path to the file containing the localized strings for a specific locale.

Details

__construct(Application $app)

Parameters

Application $app

loadTranslations(TranslatorAdapterInterface $translatorAdapter)

Loads the translations from this loader type into the given translator instance.

The given translator instance should have the correct locale already set for it which defines the loader which translations should be loaded.

Parameters

TranslatorAdapterInterface $translatorAdapter

protected string[] getLocaleIDAlternatives(string $localeID)

Get the locale identifier alternatives (eg: 'en_US' gives ['en_US', 'en']).

Parameters

string $localeID

Return Value

string[]

private string|null locateLanguageFile(Package $package, string $localeID)

Get the full path to the file containing the localized strings for a specific locale.

Parameters

Package $package The package for which you want the file path
string $localeID The ID of the locale

Return Value

string|null Returns the full path of the file if it exists, null otherwise