Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Basic adapter class for each translation source adapter
LOCALE_DIRECTORY = 'directory'
Scans for the locale within the name of the directory
LOCALE_FILENAME = 'filename'
Scans for the locale within the name of the file
boolean $_automatic = 'true'
Shows if locale detection is in automatic level
Zend_Cache_Core $_cache = 'null'
Internal cache for all adapters
boolean $_cacheTags = 'false'
Internal value to remember if cache supports tags
array $_options = 'array'
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 '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
array() $_routed = 'array'
Internal value to see already routed languages
array $_translate = 'array'
Translation table
_(
string $messageId, string|Zend_Locale $locale
=
null
)
:
string
Translates the given string returns the translation
__construct(
array|Zend_Config $options
=
array
)
:
void
Generates the adapter
_addTranslationData(
$options
=
array
)
:
Zend_Translate_Adapter
Internal function for adding translation data
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
_getTagSupportForCache(
)
:
Internal method to check if the given cache supports tags
_loadTranslationData(
mixed $data, string|Zend_Locale $locale, array $options
=
array
)
:
array
Load translation data
_log(
string $message, String $locale
)
:
Logs a message when the log option is set
addTranslation(
array|Zend_Config $options
=
array
)
:
Zend_Translate_Adapter
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
clearCache(
string $tag
=
null
)
:
void
Clears all set cache data
getCache(
)
:
Zend_Cache_Core
Returns the set cache
getList(
)
:
array
Returns the available languages from this adapter
getLocale(
)
:
Zend_Locale|string|null
Gets locale
getMessageId(
string $message, string|Zend_Locale $locale
=
null
)
:
string|array|false
Returns the message id for a given translation If no locale is given, the actual language will be used
getMessageIds(
string|Zend_Locale $locale
=
null
)
:
array
Returns all available message ids from this adapter If no locale is given, the actual language will be used
getMessages(
string|Zend_Locale $locale
=
null
)
:
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
getOptions(
string|null $optionKey
=
null
)
:
integer|string|array|null
Returns the adapters name and it's options
hasCache(
)
:
boolean
Returns true when a cache is set
isAvailable(
string|Zend_Locale $locale
)
:
boolean
Is the wished language available ?
isTranslated(
string $messageId, boolean $original
=
false, string|Zend_Locale $locale
=
null
)
:
boolean
Checks if a string is translated within the source or not returns boolean
plural(
string $singular, string $plural, integer $number, string|Zend_Locale $locale
=
null
)
:
string
Translates the given string using plural notations Returns the translated string
removeCache(
)
:
void
Removes any set cache
setCache(
Zend_Cache_Core $cache
)
:
Sets a cache for all Zend_Translate_Adapters
setLocale(
string|Zend_Locale $locale
)
:
Zend_Translate_Adapter
Sets locale
setOptions(
array $options
=
array
)
:
Zend_Translate_Adapter
Sets new adapter options
toString(
)
:
string
Returns the adapter name
translate(
string|array $messageId, string|Zend_Locale $locale
=
null
)
:
string
Translates the given string returns the translation