Zend Framework  1.12
Public Member Functions | Protected Member Functions | List of all members
Zend_Translate_Adapter_Tmx Class Reference

Public Member Functions

 toString ()
 Returns the adapter name.
 
- Public Member Functions inherited from Zend_Translate_Adapter
 __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.
 

Protected Member Functions

 _loadTranslationData ($filename, $locale, array $options=array())
 Load translation data (TMX file reader)
 
 _startElement ($file, $name, $attrib)
 Internal method, called by xml element handler at start.
 
 _endElement ($file, $name)
 Internal method, called by xml element handler at end.
 
 _contentElement ($file, $data)
 Internal method, called by xml element handler for content.
 
 _findEncoding ($filename)
 Internal method, detects the encoding of the xml file.
 
- Protected Member Functions inherited from Zend_Translate_Adapter
 _loadTranslationData ($data, $locale, array $options=array())
 Load translation data.
 
 _log ($message, $locale)
 Logs a message when the log option is set.
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Translate_Adapter
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 inherited from Zend_Translate_Adapter
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 Attributes inherited from Zend_Translate_Adapter
 $_options
 
 $_translate = array()
 
- Static Protected Attributes inherited from Zend_Translate_Adapter
static $_cache = null
 

Member Function Documentation

_contentElement (   $file,
  $data 
)
protected

Internal method, called by xml element handler for content.

Parameters
resource$fileFile handler
string$dataElements content
_endElement (   $file,
  $name 
)
protected

Internal method, called by xml element handler at end.

Parameters
resource$fileFile handler
string$nameElements name
_findEncoding (   $filename)
protected

Internal method, detects the encoding of the xml file.

Parameters
string$nameFilename
Returns
string Encoding
_loadTranslationData (   $filename,
  $locale,
array  $options = array() 
)
protected

Load translation data (TMX file reader)

Parameters
string$filenameTMX file to add, full path must be given for access
string$localeLocale has no effect for TMX because TMX defines all languages within the source file
array$optionOPTIONAL Options to use
Exceptions
Zend_Translation_Exception
Returns
array
_startElement (   $file,
  $name,
  $attrib 
)
protected

Internal method, called by xml element handler at start.

Parameters
resource$fileFile handler
string$nameElements name
array$attribAttributes for this element
toString ( )

Returns the adapter name.

Returns
string