| category |
Zend |
| package |
Zend_Translate |
| copyright |
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) |
| license |
New BSD License |
| subpackage |
Zend_Translate_Adapter |
Methods
Translates the given string
returns the translation
_(string $messageId, string | \Zend_Locale $locale) : string
Inherited
| inherited_from |
\Zend_Translate_Adapter::_() |
Parameters
$messageId
stringTranslation string
$locale
string\Zend_Locale(optional) Locale/Language to use, identical with locale identifier, @see Zend_Locale for more information
Returns
string
Generates the adapter
__construct(array | \Zend_Config $options) : void
Inherited
| inherited_from |
\Zend_Translate_Adapter::__construct() |
Parameters
$options
array\Zend_ConfigTranslation options for this adapter
Exceptions
Add translations
addTranslation(array | \Zend_Config $options) : \Zend_Translate_Adapter
Inherited
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
| inherited_from |
\Zend_Translate_Adapter::addTranslation() |
Parameters
$options
array\Zend_ConfigOptions and translations to be added
Exceptions
Returns
Clears all set cache data
clearCache(string $tag) : void
Inherited
| inherited_from |
\Zend_Translate_Adapter::clearCache() |
Parameters
$tag
stringTag to clear when the default tag name is not used
Returns the set cache
getCache() : \Zend_Cache_Core
Inherited
| inherited_from |
\Zend_Translate_Adapter::getCache() |
Returns
\Zend_Cache_CoreThe set cache
Returns the available languages from this adapter
getList() : array | null
Inherited
| inherited_from |
\Zend_Translate_Adapter::getList() |
Returns
arraynull
Gets locale
getLocale() : \Zend_Locale | string | null
Inherited
| inherited_from |
\Zend_Translate_Adapter::getLocale() |
Returns
Returns the message id for a given translation
If no locale is given, the actual language will be used
getMessageId(string $message, string | \Zend_Locale $locale) : string | array | false
Inherited
| inherited_from |
\Zend_Translate_Adapter::getMessageId() |
Parameters
$message
stringMessage to get the key for
$locale
string\Zend_Locale(optional) Language to return the message ids from
Returns
stringarrayfalse
Returns all available message ids from this adapter
If no locale is given, the actual language will be used
getMessageIds(string | \Zend_Locale $locale) : array
Inherited
| inherited_from |
\Zend_Translate_Adapter::getMessageIds() |
Parameters
$locale
string\Zend_Locale(optional) Language to return the message ids from
Returns
array
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
getMessages(string | \Zend_Locale $locale) : array
Inherited
| inherited_from |
\Zend_Translate_Adapter::getMessages() |
Parameters
$locale
string\Zend_Locale(optional) Language to return the messages from
Returns
array
Returns the adapters name and it's options
getOptions(string | null $optionKey) : integer | string | array | null
Inherited
| inherited_from |
\Zend_Translate_Adapter::getOptions() |
Parameters
$optionKey
stringnullString returns this option null returns all options
Returns
integerstringarraynull
Returns true when a cache is set
hasCache() : boolean
Inherited
| inherited_from |
\Zend_Translate_Adapter::hasCache() |
Returns
boolean
Is the wished language available ?
isAvailable(string | \Zend_Locale $locale) : boolean
Inherited
| see |
\Zend_Locale |
| see |
\Zend_Locale |
| inherited_from |
\Zend_Translate_Adapter::isAvailable() |
Parameters
$locale
string\Zend_LocaleLanguage to search for, identical with locale identifier,
Returns
boolean
Checks if a string is translated within the source or not
returns boolean
isTranslated(string $messageId, boolean $original, string | \Zend_Locale $locale) : boolean
Inherited
| inherited_from |
\Zend_Translate_Adapter::isTranslated() |
Parameters
$messageId
stringTranslation string
$original
boolean(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
$locale
string\Zend_Locale(optional) Locale/Language to use, identical with locale identifier, see Zend_Locale for more information
Returns
boolean
Translates the given string using plural notations
Returns the translated string
plural(string $singular, string $plural, integer $number, string | \Zend_Locale $locale) : string
Inherited
| see |
\Zend_Locale |
| inherited_from |
\Zend_Translate_Adapter::plural() |
Parameters
$singular
stringSingular translation string
$plural
stringPlural translation string
$number
integerNumber for detecting the correct plural
$locale
string\Zend_Locale(Optional) Locale/Language to use, identical with locale identifier, @see Zend_Locale for more information
Returns
string
Removes any set cache
removeCache() : void
Inherited
| inherited_from |
\Zend_Translate_Adapter::removeCache() |
Sets a cache for all Zend_Translate_Adapters
setCache(Zend_Cache_Core $cache)
Inherited
| inherited_from |
\Zend_Translate_Adapter::setCache() |
Parameters
$cache
\Zend_Cache_CoreCache to store to
Sets new adapter options
setOptions(array $options) : \Zend_Translate_Adapter
Inherited
| inherited_from |
\Zend_Translate_Adapter::setOptions() |
Parameters
$options
arrayAdapter options
Exceptions
Returns
returns the adapters name
toString() : string
Translates the given string
returns the translation
translate(string | array $messageId, string | \Zend_Locale $locale) : string
Inherited
| see |
\Zend_Locale |
| inherited_from |
\Zend_Translate_Adapter::translate() |
Parameters
$messageId
stringarrayTranslation string, or Array for plural translations
$locale
string\Zend_Locale(optional) Locale/Language to use, identical with locale identifier, @see Zend_Locale for more information
Returns
string
Load translation data
_loadTranslationData(string | array $data, string $locale, array $options) : array
Parameters
$data
stringarray
$locale
stringLocale/Language to add data for, identical with locale identifier, see Zend_Locale for more information
$options
arrayOPTIONAL Options to use
Returns
array
Logs a message when the log option is set
_log(string $message, String $locale)
Inherited
| inherited_from |
\Zend_Translate_Adapter::_log() |
Parameters
$message
stringMessage to log
$locale
StringLocale to log
Internal function for adding translation data
_addTranslationData($options) : \Zend_Translate_Adapter
Inherited
This may be a new language or additional data for an existing language
If the options 'clear' is true, then the translation data for the specified
language is replaced and added otherwise
| see |
\Zend_Locale |
| inherited_from |
\Zend_Translate_Adapter::_addTranslationData() |
Parameters
$options
Exceptions
Returns
Properties
Internal cache for all adapters
$_cache : \Zend_Cache_Core
Inherited
| inherited_from |
\Zend_Translate_Adapter::$$_cache |
Array with all options, each adapter can have own additional options
'clear' => when true, clears already loaded translations when adding new files
'content' => content to translate or file or directory with content
'disableNotices' => when true, omits notices from being displayed
'ignore' => a prefix for files and directories which are not being added
'locale' => the actual set locale to use
'log' => a instance of Zend_Log where logs are written to
'logMessage' => message to be logged
'logPriority' => priority which is used to write the log message
'logUntranslated' => when true, untranslated messages are not logged
'reload' => reloads the cache by reading the content again
'scan' => searches for translation files using the LOCALE constants
'tag' => tag to use for the cache
$_options : array
Inherited
| inherited_from |
\Zend_Translate_Adapter::$$_options |
Translation table
$_translate : array
Inherited
| inherited_from |
\Zend_Translate_Adapter::$$_translate |
Shows if locale detection is in automatic level
$_automatic : boolean
Inherited
| inherited_from |
\Zend_Translate_Adapter::$$_automatic |
Internal value to see already routed languages
$_routed : \array()
Inherited
| inherited_from |
\Zend_Translate_Adapter::$$_routed |
Constants
Scans for the locale within the name of the directory
LOCALE_DIRECTORY
Inherited
| constant |
integer |
| inherited_from |
\Zend_Translate_Adapter::LOCALE_DIRECTORY |
Scans for the locale within the name of the file
LOCALE_FILENAME
Inherited
| constant |
integer |
| inherited_from |
\Zend_Translate_Adapter::LOCALE_FILENAME |