Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions
Zend_Translate_Adapter_Qt Class Reference
Inheritance diagram for Zend_Translate_Adapter_Qt:
Zend_Translate_Adapter

Public Member Functions

 toString ()
 
- Public Member Functions inherited from Zend_Translate_Adapter
 __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 ()
 

Protected Member Functions

 _loadTranslationData ($filename, $locale, array $options=array())
 
- Protected Member Functions inherited from Zend_Translate_Adapter
 _loadTranslationData ($data, $locale, array $options=array())
 
 _log ($message, $locale)
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Translate_Adapter
static getCache ()
 
static setCache (Zend_Cache_Core $cache)
 
static hasCache ()
 
static removeCache ()
 
static clearCache ($tag=null)
 
- Data Fields inherited from Zend_Translate_Adapter
const LOCALE_DIRECTORY = 'directory'
 
const LOCALE_FILENAME = 'filename'
 
- Protected Attributes inherited from Zend_Translate_Adapter
 $_options
 
 $_translate = array()
 
- Static Protected Attributes inherited from Zend_Translate_Adapter
static $_cache = null
 

Detailed Description

Definition at line 41 of file Qt.php.

Member Function Documentation

◆ _loadTranslationData()

_loadTranslationData (   $filename,
  $locale,
array  $options = array() 
)
protected

Load translation data (QT file reader)

Parameters
string$localeLocale/Language to add data for, identical with locale identifier, see Zend_Locale for more information
string$filenameQT file to add, full path must be given for access
array$optionOPTIONAL Options to use
Exceptions
Zend_Translation_Exception
Returns
array

Definition at line 64 of file Qt.php.

65  {
66  $this->_data = array();
67  if (!is_readable($filename)) {
68  #require_once 'Zend/Translate/Exception.php';
69  throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.');
70  }
71 
72  $this->_target = $locale;
73 
74  $encoding = $this->_findEncoding($filename);
75  $this->_file = xml_parser_create($encoding);
76  xml_set_object($this->_file, $this);
77  xml_parser_set_option($this->_file, XML_OPTION_CASE_FOLDING, 0);
78  xml_set_element_handler($this->_file, "_startElement", "_endElement");
79  xml_set_character_data_handler($this->_file, "_contentElement");
80 
81  try {
82  Zend_Xml_Security::scanFile($filename);
83  } catch (Zend_Xml_Exception $e) {
84  #require_once 'Zend/Translate/Exception.php';
85  throw new Zend_Translate_Exception(
86  $e->getMessage()
87  );
88  }
89 
90  if (!xml_parse($this->_file, file_get_contents($filename))) {
91  $ex = sprintf('XML error: %s at line %d of file %s',
92  xml_error_string(xml_get_error_code($this->_file)),
93  xml_get_current_line_number($this->_file),
94  $filename);
95  xml_parser_free($this->_file);
96  #require_once 'Zend/Translate/Exception.php';
97  throw new Zend_Translate_Exception($ex);
98  }
99 
100  return $this->_data;
101  }

◆ toString()

toString ( )

Returns the adapter name

Returns
string

Definition at line 171 of file Qt.php.

172  {
173  return "Qt";
174  }

The documentation for this class was generated from the following file: