Public Member Functions |
| resetBaseLanguage () |
| getBaseLanguage () |
| getObjectTplLanguage () |
| getTplLanguage () |
| getEditLanguage () |
| getLanguageArray ($iLanguage=null, $blOnlyActive=false, $blSort=false) |
| getAdminTplLanguageArray () |
| getLanguageAbbr ($iLanguage=null) |
| getLanguageNames () |
| translateString ($sStringToTranslate, $iLang=null, $blAdminMode=null) |
| getSimilarByKey ($sKey, $iLang=null, $blAdmin=null) |
| formatCurrency ($dValue, $oActCur=null) |
| formatVat ($dValue, $oActCur=null) |
| getLanguageTag ($iLanguage=null) |
| validateLanguage ($iLang=null) |
| setBaseLanguage ($iLang=null) |
| setTplLanguage ($iLang=null) |
| getName () |
| getFormLang () |
| getUrlLang ($iLang=null) |
| processUrl ($sUrl, $iLang=null) |
| detectLanguageByBrowser () |
| getMultiLangTables () |
| getSeoReplaceChars ($iLang) |
| getAllShopLanguageIds () |
| getLanguageIds ($iShopId=null) |
| getActiveShopLanguageIds () |
| __call ($sMethod, $aArgs) |
| __construct () |
| getConfig () |
| setConfig ($oConfig) |
| getSession () |
| setSession ($oSession) |
| getUser () |
| setUser ($oUser) |
| isAdmin () |
| setAdminMode ($blAdmin) |
Protected Member Functions |
| _collectSimilar ($aData, $sKey, $aCollection=array()) |
| _recodeLangArray ($aLangArray, $sCharset, $blRecodeKeys=false) |
| _getLangFilesPathArray ($iLang) |
| _getAdminLangFilesPathArray ($iLang) |
| _appendLangFile ($aLangFiles, $sFullPath, $sFilePattern="lang") |
| _appendCustomLangFiles ($aLangFiles, $sLang, $blForAdmin=false) |
| _appendModuleLangFiles ($aLangFiles, $aModulePaths, $sLang, $blForAdmin=false) |
| _getLangFileCacheName ($blAdmin, $iLang, $aLangFiles=null) |
| _getLanguageFileData ($blAdmin=false, $iLang=0, $aLangFiles=null) |
| _getLanguageMap ($iLang, $blAdmin=null) |
| _getCacheLanguageId ($blAdmin, $iLang=null) |
| _getLangTranslationArray ($iLang=null, $blAdmin=null, $aLangFiles=null) |
| _sortLanguagesCallback ($a1, $a2) |
| _getActiveModuleInfo () |
| _getDisabledModuleInfo () |
| _getLanguageIdsFromDatabase ($iShopId=null) |
| _getConfigLanguageValues ($sLanguageParameterName, $iShopId=null) |
| _selectLanguageParamValues ($sParamName, $sShopId=null) |
| _getLanguageIdsFromLanguageParamsArray ($aLanguageParams) |
| _getLanguageIdsFromLanguagesArray ($aLanguages) |
Static Private Attributes |
static | $_instance = null |
Detailed Description
Language related utility class
Definition at line 6 of file oxlang.php.
Member Function Documentation
oxLang::_appendCustomLangFiles |
( |
|
$aLangFiles, |
|
|
|
$sLang, |
|
|
|
$blForAdmin = false |
|
) |
| |
|
protected |
Appends Custom language files cust_lang.php
- Parameters
-
array | $aLangFiles | existing language files |
string | $sLang | language abbreviation |
bool | $blForAdmin | add files for admin |
- Returns
- array
Definition at line 741 of file oxlang.php.
oxLang::_appendLangFile |
( |
|
$aLangFiles, |
|
|
|
$sFullPath, |
|
|
|
$sFilePattern = "lang" |
|
) |
| |
|
protected |
Appends lang or options files if exists, except custom lang files
- Parameters
-
array | $aLangFiles | existing language files |
string | $sFullPath | path to language files to append |
string | $sFilePattern | file pattern to search for, default is "lang" |
- Returns
- array
Definition at line 719 of file oxlang.php.
oxLang::_appendModuleLangFiles |
( |
|
$aLangFiles, |
|
|
|
$aModulePaths, |
|
|
|
$sLang, |
|
|
|
$blForAdmin = false |
|
) |
| |
|
protected |
Appends module lang or options files if exists
- Parameters
-
array | $aLangFiles | existing language files |
array | $aModulePaths | module language file paths |
string | $sLang | language abbreviation |
bool | $blForAdmin | add files for admin |
- Returns
- array
Definition at line 772 of file oxlang.php.
oxLang::_collectSimilar |
( |
|
$aData, |
|
|
|
$sKey, |
|
|
|
$aCollection = array() |
|
) |
| |
|
protected |
Iterates through given array ($aData) and collects data if array key is similar as searchable key ($sKey*). If you pass $aCollection, it will be appended with found items
- Parameters
-
array | $aData | array to search in |
string | $sKey | key to look for (looking for similar with strpos) |
array | $aCollection | array to append found items [optional] |
- Returns
- array
Definition at line 421 of file oxlang.php.
oxLang::_getActiveModuleInfo |
( |
| ) |
|
|
protected |
Returns active module Ids with paths
- Returns
- array
Definition at line 1146 of file oxlang.php.
oxLang::_getAdminLangFilesPathArray |
( |
|
$iLang | ) |
|
|
protected |
Returns array with paths where admin language files are stored
- Parameters
-
- Returns
- array
Definition at line 679 of file oxlang.php.
oxLang::_getCacheLanguageId |
( |
|
$blAdmin, |
|
|
|
$iLang = null |
|
) |
| |
|
protected |
Returns current language cache language id
- Parameters
-
bool | $blAdmin | admin mode |
int | $iLang | language id [optional] |
- Returns
- int
Definition at line 940 of file oxlang.php.
oxLang::_getConfigLanguageValues |
( |
|
$sLanguageParameterName, |
|
|
|
$iShopId = null |
|
) |
| |
|
protected |
Returns list of all language codes taken from config values of given 'aLanguages' (for all subshops)
- Parameters
-
string | $sLanguageParameterName | language config parameter name |
int | $iShopId | shop id |
- Returns
- array
Definition at line 1242 of file oxlang.php.
oxLang::_getDisabledModuleInfo |
( |
| ) |
|
|
protected |
Returns active module Ids with paths
- Returns
- array
Definition at line 1160 of file oxlang.php.
oxLang::_getLangFileCacheName |
( |
|
$blAdmin, |
|
|
|
$iLang, |
|
|
|
$aLangFiles = null |
|
) |
| |
|
protected |
Returns language cache file name
- Parameters
-
bool | $blAdmin | admin or not |
int | $iLang | current language id |
array | $aLangFiles | language files to load [optional] |
- Returns
- string
Definition at line 809 of file oxlang.php.
oxLang::_getLangFilesPathArray |
( |
|
$iLang | ) |
|
|
protected |
Returns array with paths where frontend language files are stored
- Parameters
-
- Returns
- array
Definition at line 627 of file oxlang.php.
oxLang::_getLangTranslationArray |
( |
|
$iLang = null , |
|
|
|
$blAdmin = null , |
|
|
|
$aLangFiles = null |
|
) |
| |
|
protected |
get language array from lang translation file
- Parameters
-
int | $iLang | optional language |
bool | $blAdmin | admin mode switch |
array | $aLangFiles | language files to load [optional] |
- Returns
- array
Definition at line 962 of file oxlang.php.
oxLang::_getLanguageFileData |
( |
|
$blAdmin = false , |
|
|
|
$iLang = 0 , |
|
|
|
$aLangFiles = null |
|
) |
| |
|
protected |
Returns language cache array
- Parameters
-
bool | $blAdmin | admin or not [optional] |
int | $iLang | current language id [optional] |
array | $aLangFiles | language files to load [optional] |
- Returns
- array
Definition at line 828 of file oxlang.php.
oxLang::_getLanguageIdsFromDatabase |
( |
|
$iShopId = null | ) |
|
|
protected |
Gets language Ids for given shopId or for all subshops
- Parameters
-
- Returns
- array
Definition at line 1226 of file oxlang.php.
oxLang::_getLanguageIdsFromLanguageParamsArray |
( |
|
$aLanguageParams | ) |
|
|
protected |
gets language code array from aLanguageParams array
- Parameters
-
- Returns
- array
Definition at line 1297 of file oxlang.php.
oxLang::_getLanguageIdsFromLanguagesArray |
( |
|
$aLanguages | ) |
|
|
protected |
gets language code array from aLanguages array
- Parameters
-
- Returns
- array
Definition at line 1315 of file oxlang.php.
oxLang::_getLanguageMap |
( |
|
$iLang, |
|
|
|
$blAdmin = null |
|
) |
| |
|
protected |
Returns language map array
- Parameters
-
int | $iLang | language index |
bool | $blAdmin | admin mode [default NULL] |
- Returns
- array
Definition at line 904 of file oxlang.php.
oxLang::_recodeLangArray |
( |
|
$aLangArray, |
|
|
|
$sCharset, |
|
|
|
$blRecodeKeys = false |
|
) |
| |
|
protected |
Goes through language array and recodes its values. Returns recoded data
- Parameters
-
array | $aLangArray | language data |
string | $sCharset | charset which was used while making file |
bool | $blRecodeKeys | leave keys untouched or recode it |
- Returns
- array
Definition at line 604 of file oxlang.php.
oxLang::_selectLanguageParamValues |
( |
|
$sParamName, |
|
|
|
$sShopId = null |
|
) |
| |
|
protected |
Returns array of all config values of given paramName
- Parameters
-
- Returns
- array
Definition at line 1272 of file oxlang.php.
oxLang::_sortLanguagesCallback |
( |
|
$a1, |
|
|
|
$a2 |
|
) |
| |
|
protected |
Language sorting callback function
- Parameters
-
object | $a1 | first value to check |
object | $a2 | second value to check |
- Returns
- bool
Definition at line 992 of file oxlang.php.
oxLang::detectLanguageByBrowser |
( |
| ) |
|
Detect language by user browser settings. Returns language ID if detected, otherwise returns null.
- Returns
- int
Definition at line 1080 of file oxlang.php.
oxLang::formatCurrency |
( |
|
$dValue, |
|
|
|
$oActCur = null |
|
) |
| |
Returns formatted number, according to active currency formatting standards.
- Parameters
-
float | $dValue | Plain price |
object | $oActCur | Object of active currency |
- Returns
- string
Definition at line 476 of file oxlang.php.
oxLang::formatVat |
( |
|
$dValue, |
|
|
|
$oActCur = null |
|
) |
| |
Returns formatted vat value, according to formatting standards.
- Parameters
-
float | $dValue | Plain price |
object | $oActCur | Object of active currency |
- Returns
- string
Definition at line 493 of file oxlang.php.
oxLang::getActiveShopLanguageIds |
( |
| ) |
|
Returns available language IDs (abbreviations)
- Returns
- array
Definition at line 1204 of file oxlang.php.
oxLang::getAdminTplLanguageArray |
( |
| ) |
|
Returns languages array containing possible admin template translations
- Returns
- array
Definition at line 314 of file oxlang.php.
oxLang::getAllShopLanguageIds |
( |
| ) |
|
Returns available language IDs (abbreviations) for all sub shops
- Returns
- array
Definition at line 1174 of file oxlang.php.
oxLang::getBaseLanguage |
( |
| ) |
|
Returns active shop language id
- Returns
- string
Definition at line 120 of file oxlang.php.
oxLang::getEditLanguage |
( |
| ) |
|
Returns editing object working language id
- Returns
- string
Definition at line 222 of file oxlang.php.
Returns form hidden language parameter
- Returns
- string
Definition at line 1012 of file oxlang.php.
static oxLang::getInstance |
( |
| ) |
|
|
static |
oxLang::getLanguageAbbr |
( |
|
$iLanguage = null | ) |
|
Returns selected language abbreviation
- Parameters
-
int | $iLanguage | language id [optional] |
- Returns
- string
Definition at line 343 of file oxlang.php.
oxLang::getLanguageArray |
( |
|
$iLanguage = null , |
|
|
|
$blOnlyActive = false , |
|
|
|
$blSort = false |
|
) |
| |
Returns array of available languages.
- Parameters
-
integer | $iLanguage | Number if current language (default null) |
bool | $blOnlyActive | load only current language or all |
bool | $blSort | enable sorting or not |
- Returns
- array
Definition at line 259 of file oxlang.php.
oxLang::getLanguageIds |
( |
|
$iShopId = null | ) |
|
Get current Shop language ids.
- Parameters
-
- Returns
- array
Definition at line 1188 of file oxlang.php.
oxLang::getLanguageNames |
( |
| ) |
|
getLanguageNames returns array of language names e.g. array('Deutch', 'English')
public
- Returns
- array
Definition at line 363 of file oxlang.php.
oxLang::getLanguageTag |
( |
|
$iLanguage = null | ) |
|
According to user configuration forms and return language prefix.
- Parameters
-
integer | $iLanguage | User selected language (default null) |
- Returns
- string
Definition at line 514 of file oxlang.php.
oxLang::getMultiLangTables |
( |
| ) |
|
Returns all multi language tables
- Returns
- array
Definition at line 1102 of file oxlang.php.
Returns language id param name
- Returns
- string
Definition at line 1002 of file oxlang.php.
oxLang::getObjectTplLanguage |
( |
| ) |
|
Returns language id used to load objects according to current template language
- Returns
- int
Definition at line 188 of file oxlang.php.
oxLang::getSeoReplaceChars |
( |
|
$iLang | ) |
|
Get SEO spec. chars replacement list for current language
- Parameters
-
- Returns
- null
Definition at line 1130 of file oxlang.php.
oxLang::getSimilarByKey |
( |
|
$sKey, |
|
|
|
$iLang = null , |
|
|
|
$blAdmin = null |
|
) |
| |
Returns array( "MY_TRANSLATION_KEY" => "MY_TRANSLATION_VALUE", ... ) by given filter "MY_TRANSLATION_" from language files
- Parameters
-
string | $sKey | key to look |
int | $iLang | language files to search [optional] |
bool | $blAdmin | admin/non admin mode [optional] |
- Returns
- array
Definition at line 442 of file oxlang.php.
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
Definition at line 208 of file oxlang.php.
oxLang::getUrlLang |
( |
|
$iLang = null | ) |
|
Returns url language parameter
- Parameters
-
int | $iLang | language id [optional] |
- Returns
- string
Definition at line 1028 of file oxlang.php.
oxLang::processUrl |
( |
|
$sUrl, |
|
|
|
$iLang = null |
|
) |
| |
Is needed appends url with language parameter Direct usage of this method to retrieve end url result is discouraged - instead see oxUtilsUrl::processUrl
- Parameters
-
string | $sUrl | url to process |
int | $iLang | language id [optional] |
- See Also
- oxUtilsUrl::processUrl
- Returns
- string
Definition at line 1050 of file oxlang.php.
oxLang::resetBaseLanguage |
( |
| ) |
|
resetBaseLanguage resets base language id cache
public
- Returns
- void
Definition at line 110 of file oxlang.php.
oxLang::setBaseLanguage |
( |
|
$iLang = null | ) |
|
Set base shop language
- Parameters
-
- Returns
- null
Definition at line 555 of file oxlang.php.
oxLang::setTplLanguage |
( |
|
$iLang = null | ) |
|
Validates and sets templates language id
- Parameters
-
- Returns
- null
Definition at line 577 of file oxlang.php.
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
-
- Returns
- string
Definition at line 386 of file oxlang.php.
oxLang::validateLanguage |
( |
|
$iLang = null | ) |
|
Validate language id. If not valid id, returns default value
- Parameters
-
- Returns
- int
Definition at line 532 of file oxlang.php.
Member Data Documentation
oxLang::$_aActiveModuleInfo = null |
|
protected |
oxLang::$_aAdditionalLangFiles = array() |
|
protected |
oxLang::$_aAdminTplLanguageArray = null |
|
protected |
oxLang::$_aDisabledModuleInfo = null |
|
protected |
oxLang::$_aLangAbbr = null |
|
protected |
oxLang::$_aLangCache = array() |
|
protected |
oxLang::$_aLangMap = array() |
|
protected |
oxLang::$_iBaseLanguageId = null |
|
protected |
oxLang::$_iEditLanguageId = null |
|
protected |
oxLang::$_instance = null |
|
staticprivate |
oxLang::$_iTplLanguageId = null |
|
protected |
The documentation for this class was generated from the following file: