Zend Framework
1.12
|
Public Member Functions | |
__construct ($options=array()) | |
Generates the adapter. | |
addTranslation ($options=array()) | |
Add translations. | |
setOptions (array $options=array()) | |
Sets new adapter options. | |
getOptions ($optionKey=null) | |
Returns the adapters name and it's options. | |
getLocale () | |
Gets locale. | |
setLocale ($locale) | |
Sets locale. | |
getList () | |
Returns the available languages from this adapter. | |
getMessageId ($message, $locale=null) | |
Returns the message id for a given translation If no locale is given, the actual language will be used. | |
getMessageIds ($locale=null) | |
Returns all available message ids from this adapter If no locale is given, the actual language will be used. | |
getMessages ($locale=null) | |
Returns all available translations from this adapter If no locale is given, the actual language will be used If 'all' is given the complete translation dictionary will be returned. | |
isAvailable ($locale) | |
Is the wished language available ? | |
translate ($messageId, $locale=null) | |
Translates the given string returns the translation. | |
plural ($singular, $plural, $number, $locale=null) | |
Translates the given string using plural notations Returns the translated string. | |
_ ($messageId, $locale=null) | |
Translates the given string returns the translation. | |
isTranslated ($messageId, $original=false, $locale=null) | |
Checks if a string is translated within the source or not returns boolean. | |
toString () | |
Returns the adapter name. | |
Static Public Member Functions | |
static | getCache () |
Returns the set cache. | |
static | setCache (Zend_Cache_Core $cache) |
Sets a cache for all Zend_Translate_Adapters. | |
static | hasCache () |
Returns true when a cache is set. | |
static | removeCache () |
Removes any set cache. | |
static | clearCache ($tag=null) |
Clears all set cache data. | |
Public Attributes | |
const | LOCALE_DIRECTORY = 'directory' |
Scans for the locale within the name of the directory integer. | |
const | LOCALE_FILENAME = 'filename' |
Scans for the locale within the name of the file integer. | |
Protected Member Functions | |
_loadTranslationData ($data, $locale, array $options=array()) | |
Load translation data. | |
_log ($message, $locale) | |
Logs a message when the log option is set. | |
Protected Attributes | |
$_options | |
$_translate = array() | |
Static Protected Attributes | |
static | $_cache = null |
__construct | ( | $options = array() | ) |
Generates the adapter.
array | Zend_Config | $options | Translation options for this adapter |
Zend_Translate_Exception |
_ | ( | $messageId, | |
$locale = null |
|||
) |
Translates the given string returns the translation.
string | $messageId | Translation string |
string | Zend_Locale | $locale | (optional) Locale/Language to use, identical with locale identifier, |
|
abstractprotected |
Load translation data.
mixed | $data | |
string | Zend_Locale | $locale | |
array | $options | (optional) |
|
protected |
Logs a message when the log option is set.
string | $message | Message to log |
String | $locale | Locale to log |
addTranslation | ( | $options = array() | ) |
Add translations.
This may be a new language or additional content for an existing language If the key 'clear' is true, then translations for the specified language will be replaced and added otherwise
array | Zend_Config | $options | Options and translations to be added |
Zend_Translate_Exception |
|
static |
Clears all set cache data.
string | $tag | Tag to clear when the default tag name is not used |
|
static |
Returns the set cache.
getList | ( | ) |
Returns the available languages from this adapter.
getLocale | ( | ) |
Gets locale.
getMessageId | ( | $message, | |
$locale = null |
|||
) |
Returns the message id for a given translation If no locale is given, the actual language will be used.
string | $message | Message to get the key for |
string | Zend_Locale | $locale | (optional) Language to return the message ids from |
getMessageIds | ( | $locale = null | ) |
Returns all available message ids from this adapter If no locale is given, the actual language will be used.
string | Zend_Locale | $locale | (optional) Language to return the message ids from |
getMessages | ( | $locale = null | ) |
Returns all available translations from this adapter If no locale is given, the actual language will be used If 'all' is given the complete translation dictionary will be returned.
string | Zend_Locale | $locale | (optional) Language to return the messages from |
getOptions | ( | $optionKey = null | ) |
Returns the adapters name and it's options.
string | null | $optionKey | String returns this option null returns all options |
|
static |
Returns true when a cache is set.
isAvailable | ( | $locale | ) |
Is the wished language available ?
string | Zend_Locale | $locale | Language to search for, identical with locale identifier, |
isTranslated | ( | $messageId, | |
$original = false , |
|||
$locale = null |
|||
) |
Checks if a string is translated within the source or not returns boolean.
string | $messageId | Translation string |
boolean | $original | (optional) Allow translation only for original language when true, a translation for 'en_US' would give false when it can be translated with 'en' only |
string | Zend_Locale | $locale | (optional) Locale/Language to use, identical with locale identifier, see Zend_Locale for more information |
plural | ( | $singular, | |
$plural, | |||
$number, | |||
$locale = null |
|||
) |
Translates the given string using plural notations Returns the translated string.
string | $singular | Singular translation string |
string | $plural | Plural translation string |
integer | $number | Number for detecting the correct plural |
string | Zend_Locale | $locale | (Optional) Locale/Language to use, identical with locale identifier, |
|
static |
Removes any set cache.
|
static |
Sets a cache for all Zend_Translate_Adapters.
Zend_Cache_Core | $cache | Cache to store to |
setLocale | ( | $locale | ) |
Sets locale.
string | Zend_Locale | $locale | Locale to set |
Zend_Translate_Exception |
setOptions | ( | array | $options = array() | ) |
Sets new adapter options.
array | $options | Adapter options |
Zend_Translate_Exception |
|
abstract |
Returns the adapter name.
translate | ( | $messageId, | |
$locale = null |
|||
) |
Translates the given string returns the translation.
string | array | $messageId | Translation string, or Array for plural translations |
string | Zend_Locale | $locale | (optional) Locale/Language to use, identical with locale identifier, |
|
staticprotected |
|
protected |
|
protected |
const LOCALE_DIRECTORY = 'directory' |
Scans for the locale within the name of the directory integer.
const LOCALE_FILENAME = 'filename' |
Scans for the locale within the name of the file integer.