Abstract Class Zend_Translate_Adapter

Description
  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
  • abstract:
  • license: New BSD License

Located in /Translate/Adapter.php (line 35)


	
			
Direct descendents
Variable Summary
 array $_languages
 string|null $_locale
 array $_options
 array $_translate
Method Summary
 Zend_Translate_Adapter __construct (string|array $data, [string|Zend_Locale $locale = null], [ $options = array()])
 void addTranslation (array|string $data, string|Zend_Locale $locale, [ $options = array()])
 array getList ()
 integer|string|array getOptions ([string|null $optionKey = null])
 boolean isAvailable (string|Zend_Locale $locale)
 boolean isTranslated (string $messageId, [boolean $original = false], [string|Zend_Locale $locale = null])
 void setLocale (string|Zend_Locale $locale)
 void setOptions ([ $options = array()])
 string toString ()
 string translate (string $messageId, [string|Zend_Locale $locale = null])
 void _loadTranslationData (mixed $data, string|Zend_Locale $locale, [ $options = array()])
Variables
array $_languages = array() (line 48)

Table of all supported languages

  • access: protected
string|null $_locale (line 41)

Current locale/language

  • access: protected
array $_options = array('clear' => false) (line 55)

Array with all options, each adapter can have own additional options

  • access: protected
array $_translate = array() (line 62)

Translation table

  • access: protected
Methods
Constructor __construct (line 74)

Generates the adapter

  • throws: Zend_Translate_Exception
  • access: public
Zend_Translate_Adapter __construct (string|array $data, [string|Zend_Locale $locale = null], [ $options = array()])
  • string|array $data: Translation data for this adapter
  • string|Zend_Locale $locale: OPTIONAL Locale/Language to set, identical with Locale identifiers see Zend_Locale for more information
  • string|array $options: Options for the adaptor

Redefined in descendants as:
addTranslation (line 199)

Add translation data

It may be a new language or additional data for existing language If $clear parameter is true, then translation data for specified language is replaced and added otherwise

  • throws: Zend_Translate_Exception
  • access: public
void addTranslation (array|string $data, string|Zend_Locale $locale, [ $options = array()])
  • array|string $data: Translation data
  • string|Zend_Locale $locale: Locale/Language to add data for, identical with locale identifier, see Zend_Locale for more information
  • array $options: OPTIONAL Option for this Adapter
getList (line 155)

Returns the avaiable languages from this adapter

  • access: public
array getList ()
getLocale (line 122)

Gets locale

  • access: public
Zend_Locale|null getLocale ()
getOptions (line 105)

Returns the adapters name and it's options

  • access: public
integer|string|array getOptions ([string|null $optionKey = null])
  • string|null $optionKey: String returns this option null returns all options
isAvailable (line 168)

Is the wished language avaiable ?

  • access: public
boolean isAvailable (string|Zend_Locale $locale)
  • string|Zend_Locale $locale: Language to search for, identical with locale identifier, see Zend_Locale for more information
isTranslated (line 267)

Checks if a string is translated within the source or not returns boolean

  • access: public
boolean isTranslated (string $messageId, [boolean $original = false], [string|Zend_Locale $locale = null])
  • 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
setLocale (line 134)

Sets locale

  • throws: Zend_Translate_Exception
  • access: public
void setLocale (string|Zend_Locale $locale)
setOptions (line 91)

Sets new adapter options

  • throws: Zend_Translate_Exception
  • access: public
void setOptions ([ $options = array()])
  • array $options: Adapter options
toString (line 309)

Returns the adapter name

  • abstract:
  • access: public
string toString ()

Redefined in descendants as:
translate (line 222)

Translates the given string returns the translation

  • access: public
string translate (string $messageId, [string|Zend_Locale $locale = null])
  • string $messageId: Translation string
  • string|Zend_Locale $locale: OPTIONAL Locale/Language to use, identical with locale identifier, see Zend_Locale for more information
_loadTranslationData (line 184)

Load translation data

  • abstract:
  • access: protected
void _loadTranslationData (mixed $data, string|Zend_Locale $locale, [ $options = array()])
  • mixed $data
  • string|Zend_Locale $locale
  • array $options

Redefined in descendants as:

Documentation generated on Sun, 27 May 2007 23:20:29 -0700 by phpDocumentor 1.3.2