Translate/Adapter/Qt.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Translate  
Version
$Id: Qt.php 24649 2012-02-26 03:37:54Z adamlundrigan $  

\Zend_Translate_Adapter_Qt

Package: Zend\Translate
Basic adapter class for each translation source adapter
Parent(s)
\Zend_Translate_Adapter
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  LOCALE_DIRECTORY = 'directory'
inherited
Scans for the locale within the name of the directory
Inherited from: \Zend_Translate_Adapter::LOCALE_DIRECTORY
Constant
integer  
Inherited_from
\Zend_Translate_Adapter::LOCALE_DIRECTORY  
>VConstant  LOCALE_FILENAME = 'filename'
inherited
Scans for the locale within the name of the file
Inherited from: \Zend_Translate_Adapter::LOCALE_FILENAME
Constant
integer  
Inherited_from
\Zend_Translate_Adapter::LOCALE_FILENAME  

Properties

>VPropertyprivateboolean $_automatic = true
inherited
Shows if locale detection is in automatic level
Inherited from: \Zend_Translate_Adapter::$$_automatic
Default valuetrueDetails
Type
boolean
Inherited_from
\Zend_Translate_Adapter::$$_automatic  
>VPropertyprotected\Zend_Cache_Core $_cache = null
staticinherited
Internal cache for all adapters
Inherited from: \Zend_Translate_Adapter::$$_cache
Default valuenullDetails
Type
\Zend_Cache_Core
Inherited_from
\Zend_Translate_Adapter::$$_cache  
>VPropertyprivateboolean $_cacheTags = false
staticinherited
Internal value to remember if cache supports tags
Inherited from: \Zend_Translate_Adapter::$$_cacheTags
Default valuefalseDetails
Type
boolean
Inherited_from
\Zend_Translate_Adapter::$$_cacheTags  
>VPropertyprivate$_cleared = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$_data = array()
Default valuearray()Details
Type
n/a
>VPropertyprivate$_file = false
Default valuefalseDetails
Type
n/a
>VPropertyprotectedarray $_options = array('clear' => false, 'content' => null, 'disableNotices' => false, 'ignore' => '.', 'locale' => 'auto', 'log' => null, 'logMessage' => "Untranslated message within '%locale%': %message%", 'logPriority' => 5, 'logUntranslated' => false, 'reload' => false, 'route' => null, 'scan' => null, 'tag' => 'Zend_Translate')
inherited
Array with all options, each adapter can have own additional options 'clear' => when true, clears already loaded translations when adding new files 'content' => content to translate or file or directory with content 'disableNotices' => when true, omits notices from being displayed 'ignore' => a prefix for files and directories which are not being added 'locale' => the actual set locale to use 'log' => a instance of Zend_Log where logs are written to 'logMessage' => message to be logged 'logPriority' => priority which is used to write the log message 'logUntranslated' => when true, untranslated messages are not logged 'reload' => reloads the cache by reading the content again 'scan' => searches for translation files using the LOCALE constants 'tag' => tag to use for the cache
Inherited from: \Zend_Translate_Adapter::$$_options
Default valuearray('clear' => false, 'content' => null, 'disableNotices' => false, 'ignore' => '.', 'locale' => 'auto', 'log' => null, 'logMessage' => "Untranslated message within '%locale%': %message%", 'logPriority' => 5, 'logUntranslated' => false, 'reload' => false, 'route' => null, 'scan' => null, 'tag' => 'Zend_Translate')Details
Type
array
Inherited_from
\Zend_Translate_Adapter::$$_options  
>VPropertyprivate\array() $_routed = array()
inherited
Internal value to see already routed languages
Inherited from: \Zend_Translate_Adapter::$$_routed
Default valuearray()Details
Type
\array()
Inherited_from
\Zend_Translate_Adapter::$$_routed  
>VPropertyprivate$_scontent = null
Default valuenullDetails
Type
n/a
>VPropertyprivate$_source = null
Default valuenullDetails
Type
n/a
>VPropertyprivate$_stag = false
Default valuefalseDetails
Type
n/a
>VPropertyprivate$_target = null
Default valuenullDetails
Type
n/a
>VPropertyprivate$_tcontent = null
Default valuenullDetails
Type
n/a
>VPropertyprotectedarray $_translate = array()
inherited
Translation table
Inherited from: \Zend_Translate_Adapter::$$_translate
Default valuearray()Details
Type
array
Inherited_from
\Zend_Translate_Adapter::$$_translate  
>VPropertyprivate$_transunit = null
Default valuenullDetails
Type
n/a
>VPropertyprivate$_ttag = true
Default valuetrueDetails
Type
n/a

Methods

methodpublic_(string $messageId, string | \Zend_Locale $locale = null) : string
inherited

Translates the given string returns the translation

Inherited from: \Zend_Translate_Adapter::_()
Parameters
NameTypeDescription
$messageIdstring

Translation string

$localestring | \Zend_Locale

(optional) Locale/Language to use, identical with locale identifier, @see Zend_Locale for more information

Returns
TypeDescription
string
methodpublic__construct(array | \Zend_Config $options = array()) : void
inherited

Generates the adapter

Inherited from: \Zend_Translate_Adapter::__construct()
Parameters
NameTypeDescription
$optionsarray | \Zend_Config

Translation options for this adapter

Throws
ExceptionDescription
\Zend_Translate_Exception
methodprivate_addTranslationData( $options = array()) : \Zend_Translate_Adapter
inherited

Internal function for adding translation data

Inherited from: \Zend_Translate_Adapter::_addTranslationData()

This may be a new language or additional data for an existing language If the options 'clear' is true, then the translation data for the specified language is replaced and added otherwise

Parameters
NameTypeDescription
$options
Returns
TypeDescription
\Zend_Translate_AdapterProvides fluent interface
Throws
ExceptionDescription
\Zend_Translate_Exception
Details
See
\Zend_Locale  
methodprivate_contentElement( $file,  $data) : void

Parameters
NameTypeDescription
$file
$data
methodprivate_endElement( $file,  $name) : void

Parameters
NameTypeDescription
$file
$name
methodprivate_findEncoding( $filename) : void

Parameters
NameTypeDescription
$filename
methodprivate_getTagSupportForCache() : void
staticinherited

Internal method to check if the given cache supports tags

Inherited from: \Zend_Translate_Adapter::_getTagSupportForCache()
methodprotected_loadTranslationData(string $filename, string $locale,  $options = array()) : array

Load translation data (QT file reader)

Parameters
NameTypeDescription
$filenamestring

QT file to add, full path must be given for access

$localestring

Locale/Language to add data for, identical with locale identifier, see Zend_Locale for more information

$options
Returns
TypeDescription
array
Throws
ExceptionDescription
\Zend_Translation_Exception
methodprotected_log(string $message, String $locale) : void
inherited

Logs a message when the log option is set

Inherited from: \Zend_Translate_Adapter::_log()
Parameters
NameTypeDescription
$messagestring

Message to log

$localeString

Locale to log

methodprivate_startElement( $file,  $name,  $attrib) : void

Parameters
NameTypeDescription
$file
$name
$attrib
methodpublicaddTranslation(array | \Zend_Config $options = array()) : \Zend_Translate_Adapter
inherited

Add translations

Inherited from: \Zend_Translate_Adapter::addTranslation()

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

Parameters
NameTypeDescription
$optionsarray | \Zend_Config

Options and translations to be added

Returns
TypeDescription
\Zend_Translate_AdapterProvides fluent interface
Throws
ExceptionDescription
\Zend_Translate_Exception
methodpublicclearCache(string $tag = null) : void
staticinherited

Clears all set cache data

Inherited from: \Zend_Translate_Adapter::clearCache()
Parameters
NameTypeDescription
$tagstring

Tag to clear when the default tag name is not used

methodpublicgetCache() : \Zend_Cache_Core
staticinherited

Returns the set cache

Inherited from: \Zend_Translate_Adapter::getCache()
Returns
TypeDescription
\Zend_Cache_CoreThe set cache
methodpublicgetList() : array | null
inherited

Returns the available languages from this adapter

Inherited from: \Zend_Translate_Adapter::getList()
Returns
TypeDescription
array | null
methodpublicgetLocale() : \Zend_Locale | string | null
inherited

Gets locale

Inherited from: \Zend_Translate_Adapter::getLocale()
Returns
TypeDescription
\Zend_Locale | string | null
methodpublicgetMessageId(string $message, string | \Zend_Locale $locale = null) : string | array | false
inherited

Returns the message id for a given translation If no locale is given, the actual language will be used

Inherited from: \Zend_Translate_Adapter::getMessageId()
Parameters
NameTypeDescription
$messagestring

Message to get the key for

$localestring | \Zend_Locale

(optional) Language to return the message ids from

Returns
TypeDescription
string | array | false
methodpublicgetMessageIds(string | \Zend_Locale $locale = null) : array
inherited

Returns all available message ids from this adapter If no locale is given, the actual language will be used

Inherited from: \Zend_Translate_Adapter::getMessageIds()
Parameters
NameTypeDescription
$localestring | \Zend_Locale

(optional) Language to return the message ids from

Returns
TypeDescription
array
methodpublicgetMessages(string | \Zend_Locale $locale = null) : array
inherited

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

Inherited from: \Zend_Translate_Adapter::getMessages()
Parameters
NameTypeDescription
$localestring | \Zend_Locale

(optional) Language to return the messages from

Returns
TypeDescription
array
methodpublicgetOptions(string | null $optionKey = null) : integer | string | array | null
inherited

Returns the adapters name and it's options

Inherited from: \Zend_Translate_Adapter::getOptions()
Parameters
NameTypeDescription
$optionKeystring | null

String returns this option null returns all options

Returns
TypeDescription
integer | string | array | null
methodpublichasCache() : boolean
staticinherited

Returns true when a cache is set

Inherited from: \Zend_Translate_Adapter::hasCache()
Returns
TypeDescription
boolean
methodpublicisAvailable(string | \Zend_Locale $locale) : boolean
inherited

Is the wished language available ?

Inherited from: \Zend_Translate_Adapter::isAvailable()
Parameters
NameTypeDescription
$localestring | \Zend_Locale

Language to search for, identical with locale identifier, @see Zend_Locale for more information

Returns
TypeDescription
boolean
Details
See
\Zend_Locale  
methodpublicisTranslated(string $messageId, boolean $original = false, string | \Zend_Locale $locale = null) : boolean
inherited

Checks if a string is translated within the source or not returns boolean

Inherited from: \Zend_Translate_Adapter::isTranslated()
Parameters
NameTypeDescription
$messageIdstring

Translation string

$originalboolean

(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

$localestring | \Zend_Locale

(optional) Locale/Language to use, identical with locale identifier, see Zend_Locale for more information

Returns
TypeDescription
boolean
methodpublicplural(string $singular, string $plural, integer $number, string | \Zend_Locale $locale = null) : string
inherited

Translates the given string using plural notations Returns the translated string

Inherited from: \Zend_Translate_Adapter::plural()
Parameters
NameTypeDescription
$singularstring

Singular translation string

$pluralstring

Plural translation string

$numberinteger

Number for detecting the correct plural

$localestring | \Zend_Locale

(Optional) Locale/Language to use, identical with locale identifier, @see Zend_Locale for more information

Returns
TypeDescription
string
Details
See
\Zend_Locale  
methodpublicremoveCache() : void
staticinherited

Removes any set cache

Inherited from: \Zend_Translate_Adapter::removeCache()
methodpublicsetCache(\Zend_Cache_Core $cache) : void
staticinherited

Sets a cache for all Zend_Translate_Adapters

Inherited from: \Zend_Translate_Adapter::setCache()
Parameters
NameTypeDescription
$cache\Zend_Cache_Core

Cache to store to

methodpublicsetLocale(string | \Zend_Locale $locale) : \Zend_Translate_Adapter
inherited

Sets locale

Inherited from: \Zend_Translate_Adapter::setLocale()
Parameters
NameTypeDescription
$localestring | \Zend_Locale

Locale to set

Returns
TypeDescription
\Zend_Translate_AdapterProvides fluent interface
Throws
ExceptionDescription
\Zend_Translate_Exception
methodpublicsetOptions(array $options = array()) : \Zend_Translate_Adapter
inherited

Sets new adapter options

Inherited from: \Zend_Translate_Adapter::setOptions()
Parameters
NameTypeDescription
$optionsarray

Adapter options

Returns
TypeDescription
\Zend_Translate_AdapterProvides fluent interface
Throws
ExceptionDescription
\Zend_Translate_Exception
methodpublictoString() : string

Returns the adapter name

Returns
TypeDescription
string
methodpublictranslate(string | array $messageId, string | \Zend_Locale $locale = null) : string
inherited

Translates the given string returns the translation

Inherited from: \Zend_Translate_Adapter::translate()
Parameters
NameTypeDescription
$messageIdstring | array

Translation string, or Array for plural translations

$localestring | \Zend_Locale

(optional) Locale/Language to use, identical with locale identifier, @see Zend_Locale for more information

Returns
TypeDescription
string
Details
See
\Zend_Locale  
Documentation was generated by phpDocumentor 2.0.0a12.