pclib
3.0.0
Lightweight PHP framework
|
Translate strings to another language. More...
Public Member Functions | |
__construct ($name=null) | |
usePage ($pageName) | |
Load translation texts for page $pageName. | |
useFile ($fileName) | |
Load translation texts from $messages array in php-file $fileName. | |
translate ($s, array $params=null) | |
Translate string $s to selected language. | |
ntranslate ($s, $n, array $params=null) | |
Translate plural form of string $s ($n is number of items). | |
translateTags ($s) | |
Translate each text in $s wrapped in <M></M> tags. | |
Public Member Functions inherited from BaseObject | |
loadDefaults ($className=null) | |
Load default parameters of class $className into object instance. | |
setProperties (array $defaults) | |
Set public properties of object from the array. More... | |
toArray () | |
Convert object to array. More... | |
Data Fields | |
$language | |
string Current language | |
$autoUpdate = false | |
bool If enabled, add new texts into db-table automatically. | |
$name | |
Translator name. More... | |
$storage | |
var TranslatorDbStorage | |
Data Fields inherited from BaseObject | |
$serviceLocator | |
var function() Return service object when requested with service(). | |
Protected Member Functions | |
getStorage () | |
Return storage object - if not exists, create one. | |
Protected Member Functions inherited from BaseObject | |
service ($service, $default=null) | |
Try acquire $service and load it into property $this->$service. More... | |
Protected Attributes | |
$pageName | |
Current page in use. | |
$cache = array() | |
array message buffer | |
Additional Inherited Members | |
Static Public Member Functions inherited from BaseObject | |
static | defaults () |
Set or retireve default parameters of the object. More... | |
Translate strings to another language.
Features:
__construct | ( | $name = null | ) |
string | $name | Translator name |
$name |
Translator name.
Table can contains texts for different translators/applications.