TranslationPlugin
extends Injectable
in package
Class TransPlugin
Table of Contents
Properties
- $config : Config
- $html : HtmlComponent
- $modules : Config
Methods
- beforeDispatch() : mixed
- Triggered after entering in the dispatch loop. At this point the dispatcher don't know if the controller or the actions to be executed exist. The Dispatcher only knows the information passed by the Router.
- loadFromModuleJson() : mixed
- Loads JSON translations from the folders of the modules.
- loadFromPhpArray() : mixed
- Loads PHP array translations from folders of the modules.
- loadFromStorageJson() : mixed
- Loads JSON translations from the storage folder.
- loadTranslations() : mixed
- Loads translations for all modules.
- registerLanguage() : stdClass
- Registers an i18n object.
Properties
$config read-only
public
Config
$config
$html read-only
public
HtmlComponent
$html
$modules read-only
public
Config
$modules
Methods
beforeDispatch()
Triggered after entering in the dispatch loop. At this point the dispatcher don't know if the controller or the actions to be executed exist. The Dispatcher only knows the information passed by the Router.
public
beforeDispatch(Event $event, Dispatcher $dispatcher) : mixed
Parameters
- $event : Event
- $dispatcher : Dispatcher
loadFromModuleJson()
Loads JSON translations from the folders of the modules.
private
loadFromModuleJson(mixed $modules, mixed $key, mixed &$translations) : mixed
Parameters
- $modules : mixed
- $key : mixed
- $translations : mixed
loadFromPhpArray()
Loads PHP array translations from folders of the modules.
private
loadFromPhpArray(mixed $modules, mixed $key, mixed &$translations) : mixed
Parameters
- $modules : mixed
- $key : mixed
- $translations : mixed
loadFromStorageJson()
Loads JSON translations from the storage folder.
private
loadFromStorageJson(mixed $modules, mixed $key, mixed &$translations) : mixed
Parameters
- $modules : mixed
- $key : mixed
- $translations : mixed
loadTranslations()
Loads translations for all modules.
private
loadTranslations(mixed $modules, mixed $i18n, mixed $source) : mixed
Parameters
- $modules : mixed
- $i18n : mixed
- $source : mixed
registerLanguage()
Registers an i18n object.
private
registerLanguage(string $language, Config $config) : stdClass
Parameters
- $language : string
- $config : Config