translateAdaptor provides basic mechanics for each translation source adaptor. It is modelled after the Zend Framework package Zend_Translate but with modifications and simplifications for Scorpio. In theory, existing ZF translation data should work with Scorpio without modification.
public __construct($inData, [$inLocale = null], [$inOptions = array()], [$inCache = null])
Returns a new adaptor instance
public addTranslation($inData, [$inLocale = null], [$inOptions = 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
public setOptions([$inOptions = array()])
Sets new adaptor options
public getOptions([$inOption = null])
Returns adaptor options if no option specified, otherwise the specific option
Global options: 'clear' => clears already loaded data when adding new files 'scan' => searches for translation files using the SEARCH_LOCALE constants 'locale' => the actual set locale to use 'ignore' => ignore files with 'disableNotices' => disable trigger notices if no translation found
public getLocale()
Returns the current locale
public setLocale($inLocale)
Sets current locale to $inLocale
public getList()
Returns the available languages from this adaptor
public getMessageIds([$inLocale = null])
Returns all available message ids from this adaptor If no locale is given, the actual language will be used
public getMessages([$inLocale = null])
Returns all available translations from this adaptor If no locale is given, the actual language will be used If 'all' is given the complete translation dictionary will be returned
public isAvailable($inLocale)
Is the wished language available ?
protected abstract _loadTranslationData($inData, $inLocale, [$inOptions = array()])
Load translation data
private _addTranslationData($inData, $inLocale, [$inOptions = array()])
Internal function for adding 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
public translate($inMessageId, [$inLocale = null])
Translates the given string, returns the translation
public __($inMessageId, [$inLocale = null])
Translates the given string, returns the translation
public isTranslated($inMessageId, [$inOriginal = false], [$inLocale = null])
Checks if a string is translated within the source or not returns boolean
public getCache()
Returns the current cacheController
public setCacheController($inCacheController)
Set $_Cache to $inCacheController
public abstract getAdaptorName()
Returns the adaptor name
Posted by: Scorpio Documentor (Writer), in Translate on 19 Nov 2009 @ 20:39
Tags: translate, translateadaptor,
This
work is licenced under a
Creative Commons Licence.