## Zend_Translate_Adapter

Description

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

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

Direct descendents

Class | Description
--- | ---
Zend_Translate_Adapter_Array |
Zend_Translate_Adapter_Csv |
Zend_Translate_Adapter_Gettext |
Zend_Translate_Adapter_Tmx |

Variable Summary
array $_languages
string|null $_locale
array $_options
array $_translate
Method Summary
Zend_Translate_Adapter __construct (string|array $options, [string|Zend_Locale $locale = null])
void addTranslation (array|string $data, string|Zend_Locale $locale, [ $option = null], boolean|string|array $clear)
array getList ()
Zend_Locale|null getLocale ()
integer|string|array getOptions ([string|null $optionKey = null])
boolean isAvailable (string|Zend_Locale $locale)
void setLocale (string|Zend_Locale $locale)
void setOptions (array $options)
string toString ()
string translate (string $messageId, [string|Zend_Locale $locale = null])
void _loadTranslationData (mixed $data, string|Zend_Locale $locale, [mixed $option = null])
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() (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 73)

Generates the adapter

- access: public
- throws: Zend_Translate_Exception

Zend_Translate_Adapter __construct (string|array $options, [string|Zend_Locale $locale = null])

- string|array $options: Options for this adapter
- string|Zend_Locale $locale: OPTIONAL Locale/Language to set, identical with Locale identifiers see Zend_Locale for more information

Redefined in descendants as:

- Zend_Translate_Adapter_Array::__construct() : Generates the adapter
- Zend_Translate_Adapter_Csv::__construct() : Generates the adapter
- Zend_Translate_Adapter_Gettext::__construct() : Generates the adapter
- Zend_Translate_Adapter_Tmx::__construct() : Generates the tmx adapter This adapter reads with php's xml_parser

addTranslation (line 198)

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

- access: public
- throws: Zend_Translate_Exception

void addTranslation (array|string $data, string|Zend_Locale $locale, [ $option = null], boolean|string|array $clear)

- 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
- boolean|string|array $clear: OPTIONAL Option for this Adapter
- $option

getList (line 154)

Returns the avaiable languages from this adapter

- access: public

array getList ()
getLocale (line 121)

Gets locale

- access: public

Zend_Locale|null getLocale ()
getOptions (line 104)

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 167)

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

setLocale (line 133)

Sets locale

- access: public
- throws: Zend_Translate_Exception

void setLocale (string|Zend_Locale $locale)

- string|Zend_Locale $locale: Locale to set

setOptions (line 90)

Sets new adapter options

- access: public
- throws: Zend_Translate_Exception

void setOptions (array $options)

- array $options: Adapter options

toString (line 259)

Returns the adapter name

- access: public
- abstract:

string toString ()

Redefined in descendants as:

- Zend_Translate_Adapter_Array::toString() : returns the adapters name
- Zend_Translate_Adapter_Csv::toString() : returns the adapters name
- Zend_Translate_Adapter_Gettext::toString() : Returns the adapter name
- Zend_Translate_Adapter_Tmx::toString() : Returns the adapter name

translate (line 221)

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 183)

Load translation data

- access: protected
- abstract:

void _loadTranslationData (mixed $data, string|Zend_Locale $locale, [mixed $option = null])

- mixed $data
- string|Zend_Locale $locale
- mixed $option

Redefined in descendants as:

- Zend_Translate_Adapter_Array::_loadTranslationData() : Load translation data
- Zend_Translate_Adapter_Csv::_loadTranslationData() : Load translation data
- Zend_Translate_Adapter_Gettext::_loadTranslationData() : Load translation data (MO file reader)
- Zend_Translate_Adapter_Tmx::_loadTranslationData() : Load translation data (TMX file reader)

Documentation generated on Wed, 21 Feb 2007 12:02:13 -0800 by phpDocumentor 1.3.1