|
eZ Publish
[4.2]
|
This provides internationalization support for text output. More...
Public Member Functions | |
| eZTranslatorManager () | |
| findKey ($key) | |
| findMessage ($context, $source, $comment=null) | |
| keyTranslate ($key) | |
| translate ($context, $source, $comment=null) | |
Static Public Member Functions | |
| static | createKey ($context, $source, $comment=null) |
| static | createMessage ($context, $source, $comment=null, $translation=null) |
| static | dynamicTranslationsEnabled () |
| static | enableDynamicTranslations ($enable=true) |
| static | instance () |
| Returns a shared instance of the eZTranslatorManager class. | |
| static | registerHandler ($handler) |
| static | resetGlobals () |
| static | resetTranslations () |
| static | setActiveTranslation ($locale, $permanently=true) |
Public Attributes | |
| $Handlers | |
| The array of handler objects. | |
| const | DYNAMIC_TRANSLATIONS_ENABLED = 'eZTMDynamicTranslationsEnabled' |
This provides internationalization support for text output.
Each message consists of:
Definition at line 53 of file eztranslatormanager.php.
| static eZTranslatorManager::createKey | ( | $ | context, |
| $ | source, | ||
| $ | comment = null |
||
| ) | [static] |
Creates an md5 key based on the $context, $source and $comment and returns it.
Definition at line 173 of file eztranslatormanager.php.
| static eZTranslatorManager::createMessage | ( | $ | context, |
| $ | source, | ||
| $ | comment = null, |
||
| $ | translation = null |
||
| ) | [static] |
Creates a message structure out of $context, $source and $comment and returns it.
Definition at line 185 of file eztranslatormanager.php.
| static eZTranslatorManager::dynamicTranslationsEnabled | ( | ) | [static] |
Definition at line 216 of file eztranslatormanager.php.
Referenced by setActiveTranslation().
| static eZTranslatorManager::enableDynamicTranslations | ( | $ | enable = true | ) | [static] |
Definition at line 224 of file eztranslatormanager.php.
| eZTranslatorManager::eZTranslatorManager | ( | ) |
Definition at line 57 of file eztranslatormanager.php.
Referenced by instance().
| eZTranslatorManager::findKey | ( | $ | key | ) |
Tries to find the translation message that matches $key in all it's handlers and returns it. If no message could be found it either means that none of the handlers have a translation for the key or that some of the handlers are not key based, for instance realtime translators. In the latter case an extra call to findMessage() or translate() is required.
Use keyTranslate if you only want to translate a message.
Definition at line 73 of file eztranslatormanager.php.
| eZTranslatorManager::findMessage | ( | $ | context, |
| $ | source, | ||
| $ | comment = null |
||
| ) |
Tries to find the translation message that matches $context, $source and $comment. If that fails it tries $context and $source only. The message is then returned or null if no translation message could be found/generated for it.
Use translate if you only want to translate a message.
Definition at line 94 of file eztranslatormanager.php.
| static eZTranslatorManager::instance | ( | ) | [static] |
Returns a shared instance of the eZTranslatorManager class.
Definition at line 150 of file eztranslatormanager.php.
Referenced by eZShuffleTranslator\findMessage(), eZ1337Translator\findMessage(), eZBorkTranslator\findMessage(), eZTSTranslator\findMessage(), eZi18nOperator\i18nTrans(), eZTSTranslator\initialize(), eZ1337Translator\initialize(), eZBorkTranslator\initialize(), eZTSTranslator\insert(), registerHandler(), eZTSTranslator\remove(), and setActiveTranslation().
| eZTranslatorManager::keyTranslate | ( | $ | key | ) |
Note this returns the exact translation for the given key, use translate() instead if you want to have variable comment support.
Definition at line 115 of file eztranslatormanager.php.
| static eZTranslatorManager::registerHandler | ( | $ | handler | ) | [static] |
Registers the handler object $handler.
Definition at line 163 of file eztranslatormanager.php.
| static eZTranslatorManager::resetGlobals | ( | ) | [static] |
Definition at line 197 of file eztranslatormanager.php.
Referenced by resetTranslations(), and setActiveTranslation().
| static eZTranslatorManager::resetTranslations | ( | ) | [static] |
Definition at line 205 of file eztranslatormanager.php.
Referenced by setActiveTranslation().
| static eZTranslatorManager::setActiveTranslation | ( | $ | locale, |
| $ | permanently = true |
||
| ) | [static] |
Definition at line 239 of file eztranslatormanager.php.
| eZTranslatorManager::translate | ( | $ | context, |
| $ | source, | ||
| $ | comment = null |
||
| ) |
Definition at line 132 of file eztranslatormanager.php.
| eZTranslatorManager::$Handlers |
The array of handler objects.
Definition at line 265 of file eztranslatormanager.php.
| const eZTranslatorManager::DYNAMIC_TRANSLATIONS_ENABLED = 'eZTMDynamicTranslationsEnabled' |
Definition at line 55 of file eztranslatormanager.php.
Referenced by enableDynamicTranslations().