Public Member Functions |
| __construct ($data, $locale=null, array $options=array()) |
| addTranslation ($data, $locale=null, array $options=array()) |
| setOptions (array $options=array()) |
| getOptions ($optionKey=null) |
| getLocale () |
| setLocale ($locale) |
| getList () |
| getMessageIds ($locale=null) |
| getMessages ($locale=null) |
| isAvailable ($locale) |
| translate ($messageId, $locale=null) |
| plural ($singular, $plural, $number, $locale=null) |
| _ ($messageId, $locale=null) |
| isTranslated ($messageId, $original=false, $locale=null) |
| toString () |
Static Public Member Functions |
static | getCache () |
static | setCache (Zend_Cache_Core $cache) |
static | hasCache () |
static | removeCache () |
static | clearCache () |
Data Fields |
const | LOCALE_DIRECTORY = 'directory' |
const | LOCALE_FILENAME = 'filename' |
Protected Member Functions |
| _loadTranslationData ($data, $locale, array $options=array()) |
| _log ($message, $locale) |
Protected Attributes |
| $_options |
| $_translate = array() |
Static Protected Attributes |
static | $_cache = null |
Detailed Description
Definition at line 42 of file Adapter.php.
Constructor & Destructor Documentation
__construct |
( |
$ |
data, |
|
|
$ |
locale = null , |
|
|
array $ |
options = array() |
|
) |
| |
Member Function Documentation
_ |
( |
$ |
messageId, |
|
|
$ |
locale = null |
|
) |
| |
Translates the given string returns the translation
- Parameters:
-
string | $messageId | Translation string |
string | Zend_Locale | $locale | (optional) Locale/Language to use, identical with locale identifier, |
- See also:
- Zend_Locale for more information
- Returns:
- string
Definition at line 643 of file Adapter.php.
_loadTranslationData |
( |
$ |
data, |
|
|
$ |
locale, |
|
|
array $ |
options = array() |
|
) |
| [abstract, protected] |
_log |
( |
$ |
message, |
|
|
$ |
locale |
|
) |
| [protected] |
Logs a message when the log option is set
- Parameters:
-
string | $message | Message to log |
String | $locale | Locale to log |
Definition at line 622 of file Adapter.php.
addTranslation |
( |
$ |
data, |
|
|
$ |
locale = null , |
|
|
array $ |
options = array() |
|
) |
| |
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
- Parameters:
-
array | string | $data | Translation data |
string | Zend_Locale | $locale | (optional) Locale/Language to add data for, identical with locale identifier, see Zend_Locale for more information |
array | $options | (optional) Option for this Adapter |
- Exceptions:
-
- Returns:
- Zend_Translate_Adapter Provides fluent interface
Definition at line 137 of file Adapter.php.
static clearCache |
( |
) |
[static] |
Clears all set cache data
- Returns:
- void
Definition at line 749 of file Adapter.php.
static getCache |
( |
) |
[static] |
Returns the available languages from this adapter
- Returns:
- array
Definition at line 357 of file Adapter.php.
Gets locale
- Returns:
- Zend_Locale|string|null
Definition at line 288 of file Adapter.php.
getMessageIds |
( |
$ |
locale = null ) |
|
Returns all available message ids from this adapter If no locale is given, the actual language will be used
- Parameters:
-
string | Zend_Locale | $locale | (optional) Language to return the message ids from |
- Returns:
- array
Definition at line 376 of file Adapter.php.
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
- Parameters:
-
string | Zend_Locale | $locale | (optional) Language to return the messages from |
- Returns:
- array
Definition at line 393 of file Adapter.php.
getOptions |
( |
$ |
optionKey = null ) |
|
Returns the adapters name and it's options
- Parameters:
-
string | null | $optionKey | String returns this option null returns all options |
- Returns:
- integer|string|array|null
Definition at line 270 of file Adapter.php.
static hasCache |
( |
) |
[static] |
Returns true when a cache is set
- Returns:
- boolean
Definition at line 725 of file Adapter.php.
Is the wished language available ?
- See also:
- Zend_Locale
- Parameters:
-
string | Zend_Locale | $locale | Language to search for, identical with locale identifier, |
- See also:
- Zend_Locale for more information
- Returns:
- boolean
Definition at line 414 of file Adapter.php.
isTranslated |
( |
$ |
messageId, |
|
|
$ |
original = false , |
|
|
$ |
locale = null |
|
) |
| |
Checks if a string is translated within the source or not returns boolean
- Parameters:
-
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 |
- Returns:
- boolean
Definition at line 660 of file Adapter.php.
plural |
( |
$ |
singular, |
|
|
$ |
plural, |
|
|
$ |
number, |
|
|
$ |
locale = null |
|
) |
| |
Translates the given string using plural notations Returns the translated string
- See also:
- Zend_Locale
- Parameters:
-
string | $singular | Singular translation string |
string | $plural | Plural translation string |
integer | $number | Number for detecting the correct plural |
string | Zend_Locale | $locale | (Optional) Locale/Language to use, identical with locale identifier, |
- See also:
- Zend_Locale for more information
- Returns:
- string
Definition at line 611 of file Adapter.php.
static removeCache |
( |
) |
[static] |
Removes any set cache
- Returns:
- void
Definition at line 739 of file Adapter.php.
Sets a cache for all Zend_Translate_Adapters
- Parameters:
-
Definition at line 715 of file Adapter.php.
setOptions |
( |
array $ |
options = array() ) |
|
translate |
( |
$ |
messageId, |
|
|
$ |
locale = null |
|
) |
| |
Translates the given string returns the translation
- See also:
- Zend_Locale
- Parameters:
-
string | array | $messageId | Translation string, or Array for plural translations |
string | Zend_Locale | $locale | (optional) Locale/Language to use, identical with locale identifier, |
- See also:
- Zend_Locale for more information
- Returns:
- string
Definition at line 515 of file Adapter.php.
Field Documentation
Initial value: array(
'clear' => false,
'disableNotices' => false,
'ignore' => '.',
'locale' => 'auto',
'log' => null,
'logMessage' => "Untranslated message within '%locale%': %message%",
'logUntranslated' => false,
'scan' => null
)
Definition at line 74 of file Adapter.php.
Scans for the locale within the name of the directory integer
Definition at line 59 of file Adapter.php.
Scans for the locale within the name of the file integer
Definition at line 65 of file Adapter.php.
The documentation for this class was generated from the following file:
- E:/E/GEAMP/www/openbiz/openbiz/others/Zend/Translate/Adapter.php