class CoreTranslationLoader extends AbstractTranslationLoader (View source)

Translation loader that loads the concrete5 core 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(string $localeID)

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

string
getAppLanguageFilePath(string $localeID)

Get the full path to the file containing the localized strings for a specific locale (in the application directory).

string
getCoreLanguageFilePath(string $localeID)

Get the full path to the file containing the localized strings for a specific locale (in the concrete directory).

Details

__construct(Application $app)

No description

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(string $localeID)

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

Parameters

string $localeID

The ID of the locale

Return Value

string|null

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

private string getAppLanguageFilePath(string $localeID)

Get the full path to the file containing the localized strings for a specific locale (in the application directory).

Parameters

string $localeID

The ID of the locale

Return Value

string

private string getCoreLanguageFilePath(string $localeID)

Get the full path to the file containing the localized strings for a specific locale (in the concrete directory).

Parameters

string $localeID

The ID of the locale

Return Value

string