Class STPHPLocale

STPHPObject
   |
   --STPHPLocale

Classes extended from STPHPLocale:

Located in File: Program_Root/stphplocale.php


The class that implements the localization of strings


Class Variable Summary
$basePath
The base path for the locale files
Default Value: -><-
$defaultDomain
The default domain
Default Value: -><-
$defaultLanguage
The default language
Default Value: -><-
$dkeys
The array of domains keys
Default Value: -><-
$dvalues
The array of domains values
Default Value: -><-
$keys
The array of keys
Default Value: -><-
$values
The array of values
Default Value: -><-

Inherited Class Variable Summary
Inherited From Class STPHPObject
Variable Default Value Description
$name -><- The name of the object

Inherited Method Summary
Inherited From Class STPHPObject
Function Description
constructor STPHPObject ( [$name = ] ) Creates the object
dtor ( ) Destructor
errorLog ( $message ) Print an error to the log system
getName ( ) Returns the name of the object

Method Summary
STPHPLocale constructor STPHPLocale ( $name )
Creates the object
string dgetText ( $value, [$domain = ''] )
Gets a translated text for the specified domain (using the default language)
string dlgetText ( $value, [$domain = ''], [$language = ''] )
Gets a translated text for the specified domain and language
void dtor ( )
Destructor
string getBasePath ( )
Gets the base path for the localization files
string getDefaultDomain ( )
Gets the default language
string getDefaultLanguage ( )
Gets the default language
string getText ( $value )
Gets a translated text (using the default domain and default language)
string lgetText ( $value, [$language = ''] )
Gets a translated text for the specified language (using the default domain)
void loadKeys ( [$fileKeys = ''] )
Loads the keys file
void loadValues ( [$language = ''], [$fileValues = ''] )
Loads the values file
void setBasePath ( $basePath )
Sets the base path for the localization files
void setDefaultDomain ( $defaultDomain )
Sets the default domain
void setDefaultLanguage ( $defaultLanguage )
Sets the default language
Variable Detail

$basePath

Data type: string
The base path for the locale files


$defaultDomain

Data type: string
The default domain


$defaultLanguage

Data type: string
The default language


$dkeys

Data type: array
The array of domains keys


$dvalues

Data type: array
The array of domains values


$keys

Data type: array
The array of keys


$values

Data type: array
The array of values



Method Detail

constructor STPHPLocale

STPHPLocale constructor STPHPLocale ( $name )

Creates the object

Function Parameters:
- string $name:
Function Info:
Access - public

dgetText

string dgetText ( $value, [$domain = ''] )

Gets a translated text for the specified domain (using the default language)

Function Parameters:
- string $value: The value to translate
- string $domain: The domain to use
Function Info:
Access - public

dlgetText

string dlgetText ( $value, [$domain = ''], [$language = ''] )

Gets a translated text for the specified domain and language

Function Parameters:
- string $value: The value to translate
- string $domain: The domain to use
- string $language: The language to use
Function Info:
Access - public

dtor

void dtor ( )

Overrides: STPHPObject::dtor()

Destructor
Destroys all the resources associated with the object
Function Parameters:
Function Info:
Access - public

getBasePath

string getBasePath ( )

Gets the base path for the localization files

Function Parameters:
Function Info:
Access - public

getDefaultDomain

string getDefaultDomain ( )

Gets the default language

Function Parameters:
Function Info:
Access - public

getDefaultLanguage

string getDefaultLanguage ( )

Gets the default language

Function Parameters:
Function Info:
Access - public

getText

string getText ( $value )

Gets a translated text (using the default domain and default language)

Function Parameters:
- string $value: The value to translate
Function Info:
Access - public

lgetText

string lgetText ( $value, [$language = ''] )

Gets a translated text for the specified language (using the default domain)

Function Parameters:
- string $value: The value to translate
- string $language: The language to use
Function Info:
Access - public

loadKeys

void loadKeys ( [$fileKeys = ''] )

Loads the keys file

Function Parameters:
- string $fileKeys: The keys file
Function Info:
Access - public

loadValues

void loadValues ( [$language = ''], [$fileValues = ''] )

Loads the values file

Function Parameters:
- string $language: The languages values to load
- string $fileValues: The values file to load
Function Info:
Access - public

setBasePath

void setBasePath ( $basePath )

Sets the base path for the localization files

Function Parameters:
- string $localeBasePath: The base path
Function Info:
Access - public

setDefaultDomain

void setDefaultDomain ( $defaultDomain )

Sets the default domain

Function Parameters:
- string $defaultDomain:
Function Info:
Access - public

setDefaultLanguage

void setDefaultLanguage ( $defaultLanguage )

Sets the default language

Function Parameters:
- string $defaultLanguage:
Function Info:
Access - public