Class Zend_Translate

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

Located in /Translate.php (line 35)


	
			
Class Constant Summary
 AN_ARRAY = 'array'
 AN_CSV = 'csv'
 AN_GETTEXT = 'gettext'
 AN_TMX = 'tmx'
 AN_XLIFF = 'xliff'
Method Summary
 void addTranslation (string|array $data, string|Zend_Locale $locale, [ $options = array()])
 Zend_Translate __construct (string $adapter, array $options, [string|Zend_Locale $locale = null])
 array getList ()
 boolean isAvailable (string|Zend_Locale $locale)
 boolean isTranslated (string $messageId, [boolean $original = false], [string|Zend_Locale $locale = null])
 void setAdapter (string $adapter, string|array $data, [string|Zend_Locale $locale = null], [ $options = array()])
 void setLocale (string|Zend_Locale $locale)
 string translate (string $messageId, [string|Zend_Locale $locale = null])
 string _ (string $messageId, [string|Zend_Locale $locale = null])
Methods
addTranslation (line 140)

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
void addTranslation (string|array $data, string|Zend_Locale $locale, [ $options = array()])
  • string|array $data: Translation data
  • string|Zend_Locale $locale: Locale/Language to add to this adapter
  • array $options: OPTIONAL Options to use
Constructor __construct (line 62)

Generates the standard translation object

  • throws: Zend_Translate_Exception
  • access: public
Zend_Translate __construct (string $adapter, array $options, [string|Zend_Locale $locale = null])
  • string $adapter: Adapter to use
  • array $options: Options for this adapter to set Depends on the Adapter
  • string|Zend_Locale $locale: OPTIONAL locale to use
getAdapter (line 123)

Returns the adapters name and it's options

  • access: public
Zend_Translate_Adapter getAdapter ()
getList (line 173)

Returns all avaiable locales/anguages from this adapter

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

Returns the actual set locale/language

  • access: public
Zend_Locale|null getLocale ()
isAvailable (line 185)

is the wished language avaiable ?

  • access: public
boolean isAvailable (string|Zend_Locale $locale)
  • string|Zend_Locale $locale: Is the locale/language avaiable
isTranslated (line 229)

Checks if a given string can be translated 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
setAdapter (line 77)

Sets a new adapter

  • throws: Zend_Translate_Exception
  • access: public
void setAdapter (string $adapter, string|array $data, [string|Zend_Locale $locale = null], [ $options = array()])
  • string $adapter: Adapter to use
  • string|array $data: Translation data
  • string|Zend_Locale $locale: OPTIONAL locale to use
  • array $options: OPTIONAL Options to use
setLocale (line 151)

Sets a new locale/language

  • access: public
void setLocale (string|Zend_Locale $locale)
  • string|Zend_Locale $locale: Locale/Language to set for translations
translate (line 211)

Translate the given string

  • access: public
string translate (string $messageId, [string|Zend_Locale $locale = null])
  • string $messageId: Original to translate
  • string|Zend_Locale $locale: OPTIONAL locale/language to translate to
_ (line 198)

Translate the given string

  • access: public
string _ (string $messageId, [string|Zend_Locale $locale = null])
  • string $messageId: Original to translate
  • string|Zend_Locale $locale: OPTIONAL locale/language to translate to
Class Constants
AN_ARRAY = 'array' (line 40)
AN_CSV = 'csv' (line 41)
AN_GETTEXT = 'gettext' (line 39)

Adapter names constants

AN_TMX = 'tmx' (line 42)
AN_XLIFF = 'xliff' (line 43)

Documentation generated on Sun, 27 May 2007 23:28:16 -0700 by phpDocumentor 1.3.2