\AKText
A simple INI-based i18n engine
Synopsis
class AKText
extends AKAbstractObject
{
- // members
- private $default_translation;
- private $strings;
- private $language;
- // Inherited members from AKAbstractObject
- protected $_errors_queue_size;
- protected $_warnings_queue_size;
- // methods
- public void __construct()
- public static Language getInstance()
- public static void _()
- public static void sprintf()
- public void dumpLanguage()
- public void asJavascript()
- public void resetTranslation()
- public void getBrowserLanguage()
- private void loadTranslation()
- public static array parse_ini_file()
- // Inherited methods from AKAbstractObject
- public void __construct()
- public string getError()
- public array getErrors()
- public void setError()
- public void resetErrors()
- public string getWarning()
- public array getWarnings()
- public void setWarning()
- public void resetWarnings()
- public void propagateToObject()
- public void propagateFromObject()
- protected void setErrorsQueueSize()
- protected void setWarningsQueueSize()
Hierarchy
Extends
Members
private
- $default_translation
—
array
The default (en_GB) translation used when no other translation is available - $language
—
string
The currently detected language (ISO code) - $strings
—
array
The array holding the translation keys
protected
- $_errors_queue_size — array
- $_warnings_queue_size — array
Methods
private
public
- __construct()
- _()
- asJavascript()
- dumpLanguage()
- getBrowserLanguage()
- getInstance() — Singleton pattern for Language
- parse_ini_file() — A PHP based INI file parser.
- resetTranslation()
- sprintf()
Inherited from AKAbstractObject
protected
- setErrorsQueueSize() — Sets the size of the error queue (acts like a LIFO buffer)
- setWarningsQueueSize() — Sets the size of the warnings queue (acts like a LIFO buffer)
public
- getError() — Get the most recent error message
- getErrors() — Return all errors, if any
- getWarning() — Get the most recent warning message
- getWarnings() — Return all warnings, if any
- propagateFromObject() — Propagates errors and warnings from a foreign object. Each propagated list is then cleared on the foreign object, as long as it implements resetErrors() and/or resetWarnings() methods.
- propagateToObject() — Propagates errors and warnings to a foreign object. The foreign object SHOULD implement the setError() and/or setWarning() methods but DOESN'T HAVE TO be of AKAbstractObject type. For example, this can even be used to propagate to a JObject instance in Joomla!. Propagated items will be removed from ourself.
- resetErrors() — Resets all error messages
- resetWarnings() — Resets all warning messages
- setError() — Add an error message
- setWarning() — Add an error message