oxLang Class Reference

Inheritance diagram for oxLang:

Inheritance graph
[legend]
Collaboration diagram for oxLang:

Collaboration graph
[legend]

List of all members.


Detailed Description

Language related utility class

Public Member Functions

 resetBaseLanguage ()
 getBaseLanguage ()
 getTplLanguage ()
 getEditLanguage ()
 getLanguageArray ($iLanguage=null)
 getLanguageAbbr ($iLanguage=null)
 getLanguageNames ()
 getLanguageIds ()
 translateString ($sStringToTranslate, $iLang=null, $blAdminMode=null)
 formatCurrency ($dValue, $oActCur=null)
 getLanguageTag ($iLanguage=null)
 validateLanguage ($iLang=null)
 setBaseLanguage ($iLang=null)
 setTplLanguage ($iLang=null)

Static Public Member Functions

static getInstance ()

Protected Member Functions

_getLangTranslationArray ($iLang=null, $blAdminMode=null)
 _readTranslateStrFromTextFile ($sStringToTranslate, $iLang=null, $blIsAdmin=null)

Protected Attributes

 $_iBaseLanguageId = null
 $_iTplLanguageId = null
 $_iEditLanguageId = null
 $_aLangCache = null
 $_aAdminLangCache = null

Static Private Attributes

static $_instance = null

Member Function Documentation

static oxLang.getInstance (  )  [static]

resturns a single instance of this class

Returns:
oxLang

oxLang.resetBaseLanguage (  ) 

resetBaseLanguage resets base language id cache

public

Returns:
void

oxLang.getBaseLanguage (  ) 

Returns active shop language id

Returns:
string

oxLang.getTplLanguage (  ) 

Returns active shop templates language id If it is not an admin area, template language id is same as base shop language id

Returns:
string

oxLang.getEditLanguage (  ) 

Returns editing object working language id

Returns:
string

oxLang.getLanguageArray ( iLanguage = null  ) 

Returns array of available languages.

Parameters:
integer $iLanguage Number if current language (default null)
Returns:
array

oxLang.getLanguageAbbr ( iLanguage = null  ) 

getLanguageNames returns array of language names e.g. array('Deutch', 'English')

Parameters:
int $iLang language number
public
Returns:
string

oxLang.getLanguageNames (  ) 

getLanguageNames returns array of language names e.g. array('Deutch', 'English')

public

Returns:
array

oxLang.getLanguageIds (  ) 

Returns available language IDs

Returns:
array

oxLang.translateString ( sStringToTranslate,
iLang = null,
blAdminMode = null 
)

Searches for translation string in file and on success returns translation, otherwise returns initial string.

Parameters:
string $sStringToTranslate Initial string
int $iLang optional language number
bool $blAdminMode on special case you can force mode, to load language constant from admin/shops language file
Exceptions:
oxLanguageException in debug mode
Returns:
string

oxLang.formatCurrency ( dValue,
oActCur = null 
)

Returns formatted currency string, according to formatting standards.

Parameters:
double $dValue Plain price
object $oActCur Object of active currency
Returns:
string

oxLang.getLanguageTag ( iLanguage = null  ) 

According to user configuration forms and return language prefix.

Parameters:
integer $iLanguage User selected language (default null)
Returns:
string

& oxLang._getLangTranslationArray ( iLang = null,
blAdminMode = null 
) [protected]

get language array from lang translation file

Parameters:
int $iLang optional language
bool $blAdminMode admin mode switch
Returns:
array

oxLang._readTranslateStrFromTextFile ( sStringToTranslate,
iLang = null,
blIsAdmin = null 
) [protected]

translates a given string

Parameters:
string $sStringToTranslate string that should be translated
int $iLang language id (optional)
bool $blIsAdmin admin mode switch (default null)
Returns:
string translation

oxLang.validateLanguage ( iLang = null  ) 

Validate language id. If not valid id, returns default value

Parameters:
int $iLang Language id
Returns:
int

oxLang.setBaseLanguage ( iLang = null  ) 

Set base shop language

Parameters:
int $iLang Language id
Returns:
null

oxLang.setTplLanguage ( iLang = null  ) 

Set templates language id

Parameters:
int $iLang Language id
Returns:
null


Member Data Documentation

oxLang.$_instance = null [static, private]

oxLang.$_iBaseLanguageId = null [protected]

oxLang.$_iTplLanguageId = null [protected]

oxLang.$_iEditLanguageId = null [protected]

oxLang.$_aLangCache = null [protected]

oxLang.$_aAdminLangCache = null [protected]


The documentation for this class was generated from the following file:

Generated on Wed Oct 29 23:44:37 2008 for OXID eShop CE by  doxygen 1.5.5