Class Translator
Search for a string translation looking to all the language catalogs provided
by a hierarchy of modules.
The string lookup procedes up to the root of the hierarchy by invoking
the module getParent() method.
-
Nethgui\View\Translator
implements
Nethgui\View\TranslatorInterface,
Nethgui\Utility\PhpConsumerInterface,
Nethgui\Log\LogConsumerInterface
Methods summary
public
|
#
__construct( string $languageCode, callable $catalogResolver, array $notUsed = array() )
Parameters
- $languageCode
- 639-1 language code (2 characters)
- $catalogResolver
- $notUsed
- $initialCatalogStack
|
public
string
|
#
translate( Nethgui\Module\ModuleInterface $module, string $key, array $args = array(), string $languageCode = NULL )
Translate $key substituting $args
Translate $key substituting $args
Any occurence of "${ID}" in the translated string is
substituted by the value in $args corresponding to
index "ID".
Parameters
- $module
- $key
- The string to be translated
- $args
- Values substituted in output string.
- $languageCode
- The language code
Returns
string
See
strtr()
Implementation of
|
public
Nethgui\Utility\PhpConsumerInterface
|
|
public
Nethgui\Log\LogInterface
|
#
getLog( )
The log attached to the interface implementor
The log attached to the interface implementor
Returns
Api
Implementation of
|
public
Nethgui\Log\LogConsumerInterface
|
#
setLog( Nethgui\Log\LogInterface $log )
Change the log attached to the interface implementor
Change the log attached to the interface implementor
Parameters
Returns
Api
Implementation of
|
public
string
|
#
getLanguageCode( )
Get the default language code
Get the default language code
Returns
string ISO 639-1 language code (2 characters).
Api
Implementation of
|