|
eZ Publish
[trunk]
|
Inheritance diagram for eZTSTranslator:
Collaboration diagram for eZTSTranslator:Public Member Functions | |
| eZTSTranslator ($locale, $filename=null, $useCache=true) | |
| Constructs the translator and loads the translation file $file if it is set and exists. | |
| findKey ($key) | |
| Returns the message that matches a translation md5 key. | |
| findMessage ($context, $source, $comment=null) | |
| Returns the message that matches a context / source / comment. | |
| handleContextNode ($context) | |
| Handles a DOM Context node and the messages it contains. | |
| handleMessageNode ($contextName, $message) | |
| Handles a translation message DOM node. | |
| hasInitializedContext ($context) | |
| Checks if a context has been initialized (cached) | |
| insert ($context, $source, $translation, $comment=null) | |
| Inserts the translation $translation for the context $context and source $source as a translation message. | |
| keyTranslate ($key) | |
| Returns the translation for a translation md5 key. | |
| load ($requestedContext) | |
| Tries to load the context $requestedContext for the translation and returns true if was successful. | |
| loadTranslationFile ($locale, $filename, $requestedContext) | |
| Loads a translation file Will load from cache if possible, or generate cache if needed. | |
| remove ($context, $source, $message=null) | |
| Removes the translation message with context $context and source $source. | |
| removeKey ($key) | |
| Removes the translation message with the key $key. | |
| translate ($context, $source, $comment=null) | |
| Translates a context + source + comment. | |
Static Public Member Functions | |
| static | expireCache ($timestamp=false, $locale=null) |
| Expires the translation cache. | |
| static | fetchList ($localeList=array()) |
| Fetches the list of available translations, as an eZTSTranslator for each translation. | |
| static | initialize ($context, $locale, $filename, $useCache=true) |
| Initialize the ts translator and context if this is not already done. | |
| static | resetGlobals () |
| Resets the in-memory translations table. | |
| static | validateDOMTree ($tree) |
| Validates the DOM tree $tree and returns true if it is correct. | |
Public Attributes | |
| $BuildCache | |
| $CachedMessages | |
| $File | |
| $Messages | |
| $UseCache | |
| const | EXPIRY_KEY = 'ts-translation-cache' |
| Translation expiry key used by eZExpiryHandler to manage translation caches. | |
Definition at line 16 of file eztstranslator.php.
| static eZTSTranslator::expireCache | ( | $ | timestamp = false, |
| $ | locale = null |
||
| ) | [static] |
Expires the translation cache.
| int | $timestamp | An optional timestamp cache should be exired from. Current timestamp used by default |
| string | $locale | Optional translation's locale to expire specifically. Expires global ts cache by default. |
Definition at line 733 of file eztstranslator.php.
Referenced by eZCache\clearTSTranslationCache().
| eZTSTranslator::eZTSTranslator | ( | $ | locale, |
| $ | filename = null, |
||
| $ | useCache = true |
||
| ) |
Constructs the translator and loads the translation file $file if it is set and exists.
| string | $locale | |
| string | $filename | |
| bool | $useCache |
Definition at line 24 of file eztstranslator.php.
Referenced by fetchList(), and initialize().
| static eZTSTranslator::fetchList | ( | $ | localeList = array() | ) | [static] |
Fetches the list of available translations, as an eZTSTranslator for each translation.
| array | $localList |
Definition at line 681 of file eztstranslator.php.
| eZTSTranslator::findKey | ( | $ | key | ) | [virtual] |
Returns the message that matches a translation md5 key.
| string | $key |
Implements eZTranslatorHandler.
Definition at line 541 of file eztstranslator.php.
Referenced by findMessage(), and keyTranslate().
| eZTSTranslator::findMessage | ( | $ | context, |
| $ | source, | ||
| $ | comment = null |
||
| ) | [virtual] |
Returns the message that matches a context / source / comment.
| string | $context | |
| string | $source | |
| string | $comment |
Implements eZTranslatorHandler.
Definition at line 558 of file eztstranslator.php.
Referenced by translate().
| eZTSTranslator::handleContextNode | ( | $ | context | ) |
Handles a DOM Context node and the messages it contains.
| DOMNode | $context |
Definition at line 386 of file eztstranslator.php.
Referenced by loadTranslationFile().
| eZTSTranslator::handleMessageNode | ( | $ | contextName, |
| $ | message | ||
| ) |
Handles a translation message DOM node.
| string | $contextName | |
| DOMNode | $message |
Definition at line 448 of file eztstranslator.php.
Referenced by handleContextNode().
| eZTSTranslator::hasInitializedContext | ( | $ | context | ) |
Checks if a context has been initialized (cached)
| string | $context |
Definition at line 86 of file eztstranslator.php.
| static eZTSTranslator::initialize | ( | $ | context, |
| $ | locale, | ||
| $ | filename, | ||
| $ | useCache = true |
||
| ) | [static] |
Initialize the ts translator and context if this is not already done.
| string | $context | |
| string | $locale | |
| string | $filename | |
| bool | $useCache |
Definition at line 53 of file eztstranslator.php.
Referenced by eZi18nOperator\i18nTrans(), and ezpI18n\translateText().
| eZTSTranslator::insert | ( | $ | context, |
| $ | source, | ||
| $ | translation, | ||
| $ | comment = null |
||
| ) |
Inserts the translation $translation for the context $context and source $source as a translation message.
Returns the key for the message. If $comment is non-null it will be included in the message.
If the translation message exists no new message is created and the existing key is returned.
| string | $context | |
| string | $source | |
| string | $translation | |
| string | $comment |
Definition at line 620 of file eztstranslator.php.
Referenced by handleMessageNode().
| eZTSTranslator::keyTranslate | ( | $ | key | ) | [virtual] |
Returns the translation for a translation md5 key.
| string | $key |
Implements eZTranslatorHandler.
Definition at line 578 of file eztstranslator.php.
| eZTSTranslator::load | ( | $ | requestedContext | ) |
Tries to load the context $requestedContext for the translation and returns true if was successful.
| string | $requestedContext |
Definition at line 97 of file eztstranslator.php.
| eZTSTranslator::loadTranslationFile | ( | $ | locale, |
| $ | filename, | ||
| $ | requestedContext | ||
| ) |
Loads a translation file Will load from cache if possible, or generate cache if needed.
Also checks for translation files expiry based on mtime if RegionalSettings.TranslationCheckMTime is enabled
private
| string | $locale | |
| string | $filename | |
| string | $requestedContext |
Definition at line 115 of file eztstranslator.php.
Referenced by load().
| eZTSTranslator::remove | ( | $ | context, |
| $ | source, | ||
| $ | message = null |
||
| ) |
Removes the translation message with context $context and source $source.
If you have the translation key use removeKey() instead.
| string | $context | |
| string | $source | |
| string | $message |
Definition at line 651 of file eztstranslator.php.
| eZTSTranslator::removeKey | ( | $ | key | ) |
Removes the translation message with the key $key.
| string | $key | The translation md5 key |
Definition at line 668 of file eztstranslator.php.
| static eZTSTranslator::resetGlobals | ( | ) | [static] |
Resets the in-memory translations table.
Definition at line 719 of file eztstranslator.php.
Referenced by expireCache().
| eZTSTranslator::translate | ( | $ | context, |
| $ | source, | ||
| $ | comment = null |
||
| ) | [virtual] |
Translates a context + source + comment.
| string | $context | |
| string | $source | |
| string | $comment |
Implements eZTranslatorHandler.
Definition at line 596 of file eztstranslator.php.
| static eZTSTranslator::validateDOMTree | ( | $ | tree | ) | [static] |
Validates the DOM tree $tree and returns true if it is correct.
| DOMDocument | $tree |
Definition at line 371 of file eztstranslator.php.
Referenced by loadTranslationFile().
| eZTSTranslator::$BuildCache |
Definition at line 756 of file eztstranslator.php.
| eZTSTranslator::$CachedMessages |
Definition at line 757 of file eztstranslator.php.
| eZTSTranslator::$File |
Definition at line 754 of file eztstranslator.php.
| eZTSTranslator::$Messages |
Definition at line 753 of file eztstranslator.php.
| eZTSTranslator::$UseCache |
Definition at line 755 of file eztstranslator.php.
| const eZTSTranslator::EXPIRY_KEY = 'ts-translation-cache' |
Translation expiry key used by eZExpiryHandler to manage translation caches.
Definition at line 762 of file eztstranslator.php.