|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
| __construct ($options=array()) | |
| addTranslation ($options=array()) | |
| setOptions (array $options=array()) | |
| getOptions ($optionKey=null) | |
| getLocale () | |
| setLocale ($locale) | |
| getList () | |
| getMessageId ($message, $locale=null) | |
| 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 ($tag=null) |
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 |
Definition at line 42 of file Adapter.php.
| __construct | ( | $options = array() | ) |
Generates the adapter
| string | array | Zend_Config | $options | Translation options for this adapter |
| string|array | [$content] | |
| string|Zend_Locale | [$locale] |
| Zend_Translate_Exception |
Definition at line 128 of file Adapter.php.
| _ | ( | $messageId, | |
$locale = null |
|||
| ) |
Translates the given string returns the translation
| string | $messageId | Translation string |
| string | Zend_Locale | $locale | (optional) Locale/Language to use, identical with locale identifier, |
Definition at line 853 of file Adapter.php.
|
abstractprotected |
Load translation data
| mixed | $data | |
| string | Zend_Locale | $locale | |
| array | $options | (optional) |
|
protected |
Logs a message when the log option is set
| string | $message | Message to log |
| String | $locale | Locale to log |
Definition at line 832 of file Adapter.php.
| addTranslation | ( | $options = array() | ) |
Add translations
This may be a new language or additional content for an existing language If the key 'clear' is true, then translations for the specified language will be replaced and added otherwise
| array | Zend_Config | $options | Options and translations to be added |
| Zend_Translate_Exception |
Definition at line 197 of file Adapter.php.
|
static |
Clears all set cache data
| string | $tag | Tag to clear when the default tag name is not used |
Definition at line 959 of file Adapter.php.
|
static |
Returns the set cache
Definition at line 913 of file Adapter.php.
| getList | ( | ) |
Returns the available languages from this adapter
Definition at line 484 of file Adapter.php.
| getLocale | ( | ) |
| getMessageId | ( | $message, | |
$locale = null |
|||
| ) |
Returns the message id for a given translation If no locale is given, the actual language will be used
| string | $message | Message to get the key for |
| string | Zend_Locale | $locale | (optional) Language to return the message ids from |
Definition at line 504 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
| string | Zend_Locale | $locale | (optional) Language to return the message ids from |
Definition at line 520 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
| string | Zend_Locale | $locale | (optional) Language to return the messages from |
Definition at line 537 of file Adapter.php.
| getOptions | ( | $optionKey = null | ) |
Returns the adapters name and it's options
| string | null | $optionKey | String returns this option null returns all options |
Definition at line 393 of file Adapter.php.
|
static |
| isAvailable | ( | $locale | ) |
Is the wished language available ?
| string | Zend_Locale | $locale | Language to search for, identical with locale identifier, |
Definition at line 558 of file Adapter.php.
| isTranslated | ( | $messageId, | |
$original = false, |
|||
$locale = null |
|||
| ) |
Checks if a string is translated within the source or not returns boolean
| 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 |
Definition at line 870 of file Adapter.php.
| plural | ( | $singular, | |
| $plural, | |||
| $number, | |||
$locale = null |
|||
| ) |
Translates the given string using plural notations Returns the translated string
| 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, |
Definition at line 821 of file Adapter.php.
|
static |
|
static |
Sets a cache for all Zend_Translate_Adapters
| Zend_Cache_Core | $cache | Cache to store to |
Definition at line 923 of file Adapter.php.
| setLocale | ( | $locale | ) |
Sets locale
| string | Zend_Locale | $locale | Locale to set |
| Zend_Translate_Exception |
Definition at line 423 of file Adapter.php.
| setOptions | ( | array | $options = array() | ) |
Sets new adapter options
| array | $options | Adapter options |
| Zend_Translate_Exception |
Definition at line 346 of file Adapter.php.
|
abstract |
Returns the adapter name
| translate | ( | $messageId, | |
$locale = null |
|||
| ) |
Translates the given string returns the translation
| string | array | $messageId | Translation string, or Array for plural translations |
| string | Zend_Locale | $locale | (optional) Locale/Language to use, identical with locale identifier, |
Definition at line 701 of file Adapter.php.
|
staticprotected |
Definition at line 59 of file Adapter.php.
|
protected |
Definition at line 97 of file Adapter.php.
|
protected |
Definition at line 117 of file Adapter.php.
| const LOCALE_DIRECTORY = 'directory' |
Scans for the locale within the name of the directory @constant integer
Definition at line 72 of file Adapter.php.
| const LOCALE_FILENAME = 'filename' |
Scans for the locale within the name of the file @constant integer
Definition at line 78 of file Adapter.php.