|
| _collectSimilar ($aData, $sKey, $aCollection=[]) |
|
| _recodeLangArray ($aLangArray, $sCharset, $blRecodeKeys=false) |
|
| _recodeLangArrayValues (&$aLangArray, $sCharset, $newEncoding) |
|
| _recodeLangArrayWithKeys ($aLangArray, $sCharset, $newEncoding) |
|
| getTranslationsExpectedEncoding () |
|
| _getLangFilesPathArray ($iLang) |
|
| getCustomThemeLanguageFiles ($language) |
|
| _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 () |
|
| _getBrowserLanguage () |
|
| _getLanguageIdsFromDatabase ($shopId=null) |
|
| _getConfigLanguageValues ($sLanguageParameterName, $iShopId=null) |
|
| _selectLanguageParamValues ($sParamName, $sShopId=null) |
|
| _getLanguageIdsFromLanguageParamsArray ($aLanguageParams) |
|
| _getLanguageIdsFromLanguagesArray ($aLanguages) |
|
| getModuleTranslationPathFinder () |
|
Language related utility class
◆ _appendCustomLangFiles()
OxidEsales\EshopCommunity\Core\Language::_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
◆ _appendLangFile()
OxidEsales\EshopCommunity\Core\Language::_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
◆ _appendModuleLangFiles()
OxidEsales\EshopCommunity\Core\Language::_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
◆ _collectSimilar()
OxidEsales\EshopCommunity\Core\Language::_collectSimilar |
( |
|
$aData, |
|
|
|
$sKey, |
|
|
|
$aCollection = [] |
|
) |
| |
|
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
◆ _getActiveModuleInfo()
OxidEsales\EshopCommunity\Core\Language::_getActiveModuleInfo |
( |
| ) |
|
|
protected |
Returns active module Ids with paths
- Returns
- array
◆ _getAdminLangFilesPathArray()
OxidEsales\EshopCommunity\Core\Language::_getAdminLangFilesPathArray |
( |
|
$iLang | ) |
|
|
protected |
Returns array with paths where admin language files are stored
- Parameters
-
- Returns
- array
◆ _getBrowserLanguage()
OxidEsales\EshopCommunity\Core\Language::_getBrowserLanguage |
( |
| ) |
|
|
protected |
Gets browser language.
- Returns
- string
◆ _getCacheLanguageId()
OxidEsales\EshopCommunity\Core\Language::_getCacheLanguageId |
( |
|
$blAdmin, |
|
|
|
$iLang = null |
|
) |
| |
|
protected |
Returns current language cache language id
- Parameters
-
bool | $blAdmin | admin mode |
int | $iLang | language id [optional] |
- Returns
- int
◆ _getConfigLanguageValues()
OxidEsales\EshopCommunity\Core\Language::_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
◆ _getDisabledModuleInfo()
OxidEsales\EshopCommunity\Core\Language::_getDisabledModuleInfo |
( |
| ) |
|
|
protected |
Returns active module Ids with paths
- Returns
- array
◆ _getLangFileCacheName()
OxidEsales\EshopCommunity\Core\Language::_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
◆ _getLangFilesPathArray()
OxidEsales\EshopCommunity\Core\Language::_getLangFilesPathArray |
( |
|
$iLang | ) |
|
|
protected |
Returns array with paths where frontend language files are stored
- Parameters
-
- Returns
- array
◆ _getLangTranslationArray()
OxidEsales\EshopCommunity\Core\Language::_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
◆ _getLanguageFileData()
OxidEsales\EshopCommunity\Core\Language::_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
◆ _getLanguageIdsFromDatabase()
OxidEsales\EshopCommunity\Core\Language::_getLanguageIdsFromDatabase |
( |
|
$shopId = null | ) |
|
|
protected |
Gets language Ids for given shopId or for all subshops
- Parameters
-
- Returns
- array
◆ _getLanguageIdsFromLanguageParamsArray()
OxidEsales\EshopCommunity\Core\Language::_getLanguageIdsFromLanguageParamsArray |
( |
|
$aLanguageParams | ) |
|
|
protected |
gets language code array from aLanguageParams array
- Parameters
-
array | $aLanguageParams | Language parameters |
- Returns
- array
◆ _getLanguageIdsFromLanguagesArray()
OxidEsales\EshopCommunity\Core\Language::_getLanguageIdsFromLanguagesArray |
( |
|
$aLanguages | ) |
|
|
protected |
gets language code array from aLanguages array
- Parameters
-
array | $aLanguages | Languages |
- Returns
- array
◆ _getLanguageMap()
OxidEsales\EshopCommunity\Core\Language::_getLanguageMap |
( |
|
$iLang, |
|
|
|
$blAdmin = null |
|
) |
| |
|
protected |
Returns language map array
- Parameters
-
int | $iLang | language index |
bool | $blAdmin | admin mode [default NULL] |
- Returns
- array
◆ _recodeLangArray()
OxidEsales\EshopCommunity\Core\Language::_recodeLangArray |
( |
|
$aLangArray, |
|
|
|
$sCharset, |
|
|
|
$blRecodeKeys = false |
|
) |
| |
|
protected |
Goes through language array and recodes its values if encoding does not fit with needed one. 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 |
- Deprecated:
- since 6.0 (2016-12-07) As the shop installation is utf-8, this method will be removed.
- Returns
- array
◆ _recodeLangArrayValues()
OxidEsales\EshopCommunity\Core\Language::_recodeLangArrayValues |
( |
& |
$aLangArray, |
|
|
|
$sCharset, |
|
|
|
$newEncoding |
|
) |
| |
|
protected |
Goes through language array and recodes its values.
- Parameters
-
array | $aLangArray | language data |
string | $sCharset | charset which was used while making file |
string | $newEncoding | charset which was used while making file |
- Deprecated:
- since 6.0 (2016-12-07) As the shop installation is utf-8, this method will be removed.
◆ _recodeLangArrayWithKeys()
OxidEsales\EshopCommunity\Core\Language::_recodeLangArrayWithKeys |
( |
|
$aLangArray, |
|
|
|
$sCharset, |
|
|
|
$newEncoding |
|
) |
| |
|
protected |
Goes through language array and recodes its values and keys. Returns recoded data
- Parameters
-
array | $aLangArray | language data |
string | $sCharset | charset which was used while making file |
string | $newEncoding | charset which was used while making file |
- Deprecated:
- since 6.0 (2016-12-07) As the shop installation is utf-8, this method will be removed.
- Returns
- array
◆ _selectLanguageParamValues()
OxidEsales\EshopCommunity\Core\Language::_selectLanguageParamValues |
( |
|
$sParamName, |
|
|
|
$sShopId = null |
|
) |
| |
|
protected |
Returns array of all config values of given paramName
- Parameters
-
string | $sParamName | Parameter name |
string | null | $sShopId | Shop id |
- Returns
- array
◆ _sortLanguagesCallback()
OxidEsales\EshopCommunity\Core\Language::_sortLanguagesCallback |
( |
|
$a1, |
|
|
|
$a2 |
|
) |
| |
|
protected |
Language sorting callback function
- Parameters
-
object | $a1 | first value to check |
object | $a2 | second value to check |
- Returns
- bool
◆ detectLanguageByBrowser()
OxidEsales\EshopCommunity\Core\Language::detectLanguageByBrowser |
( |
| ) |
|
Detect language by user browser settings. Returns language ID if detected, otherwise returns null.
- Returns
- int
◆ formatCurrency()
OxidEsales\EshopCommunity\Core\Language::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
◆ formatVat()
OxidEsales\EshopCommunity\Core\Language::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
◆ getActiveShopLanguageIds()
OxidEsales\EshopCommunity\Core\Language::getActiveShopLanguageIds |
( |
| ) |
|
Returns available language IDs (abbreviations)
- Returns
- array
◆ getAdminTplLanguageArray()
OxidEsales\EshopCommunity\Core\Language::getAdminTplLanguageArray |
( |
| ) |
|
Returns languages array containing possible admin template translations
- Returns
- array
◆ getAllShopLanguageIds()
OxidEsales\EshopCommunity\Core\Language::getAllShopLanguageIds |
( |
| ) |
|
Returns available language IDs (abbreviations) for all sub shops
- Returns
- array
◆ getBaseLanguage()
OxidEsales\EshopCommunity\Core\Language::getBaseLanguage |
( |
| ) |
|
Returns active shop language id
- Returns
- string
◆ getCustomThemeLanguageFiles()
OxidEsales\EshopCommunity\Core\Language::getCustomThemeLanguageFiles |
( |
|
$language | ) |
|
|
protected |
Returns custom theme language files.
- Parameters
-
int | $language | active language |
- Returns
- array
◆ getEditLanguage()
OxidEsales\EshopCommunity\Core\Language::getEditLanguage |
( |
| ) |
|
Returns editing object working language id
- Returns
- string
◆ getFormLang()
OxidEsales\EshopCommunity\Core\Language::getFormLang |
( |
| ) |
|
Returns form hidden language parameter
- Returns
- string
◆ getLanguageAbbr()
OxidEsales\EshopCommunity\Core\Language::getLanguageAbbr |
( |
|
$iLanguage = null | ) |
|
Returns selected language abbreviation
- Parameters
-
int | $iLanguage | language id [optional] |
- Returns
- string
◆ getLanguageArray()
OxidEsales\EshopCommunity\Core\Language::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
◆ getLanguageIds()
OxidEsales\EshopCommunity\Core\Language::getLanguageIds |
( |
|
$iShopId = null | ) |
|
Get current Shop language ids.
- Parameters
-
- Returns
- array
◆ getLanguageNames()
OxidEsales\EshopCommunity\Core\Language::getLanguageNames |
( |
| ) |
|
getLanguageNames returns array of language names e.g. array('Deutch', 'English')
@access public
- Returns
- array
◆ getLanguageTag()
OxidEsales\EshopCommunity\Core\Language::getLanguageTag |
( |
|
$iLanguage = null | ) |
|
According to user configuration forms and return language prefix.
- Parameters
-
integer | $iLanguage | User selected language (default null) |
- Returns
- string
◆ getModuleTranslationPathFinder()
OxidEsales\EshopCommunity\Core\Language::getModuleTranslationPathFinder |
( |
| ) |
|
|
protected |
Getter for the module translation path finder.
- Returns
- \OxidEsales\Eshop\Core\Module\ModuleTranslationPathFinder The module translation finder.
◆ getMultiLangTables()
OxidEsales\EshopCommunity\Core\Language::getMultiLangTables |
( |
| ) |
|
Returns all multi language tables
- Returns
- array
◆ getName()
OxidEsales\EshopCommunity\Core\Language::getName |
( |
| ) |
|
Returns language id param name
- Returns
- string
◆ getObjectTplLanguage()
OxidEsales\EshopCommunity\Core\Language::getObjectTplLanguage |
( |
| ) |
|
Returns language id used to load objects according to current template language
- Returns
- int
◆ getSeoReplaceChars()
OxidEsales\EshopCommunity\Core\Language::getSeoReplaceChars |
( |
|
$iLang | ) |
|
Get SEO spec. chars replacement list for current language
- Parameters
-
- Returns
- null
◆ getSimilarByKey()
OxidEsales\EshopCommunity\Core\Language::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
◆ getTplLanguage()
OxidEsales\EshopCommunity\Core\Language::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
◆ getTranslationsExpectedEncoding()
OxidEsales\EshopCommunity\Core\Language::getTranslationsExpectedEncoding |
( |
| ) |
|
|
protected |
Returns the encoding all translations will be converted to.
- Returns
- string
◆ getUrlLang()
OxidEsales\EshopCommunity\Core\Language::getUrlLang |
( |
|
$iLang = null | ) |
|
Returns url language parameter
- Parameters
-
int | $iLang | language id [optional] |
- Returns
- string
◆ isTranslated()
OxidEsales\EshopCommunity\Core\Language::isTranslated |
( |
| ) |
|
Set translation state
- Returns
- bool
◆ processUrl()
OxidEsales\EshopCommunity\Core\Language::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 \OxidEsales\Eshop\Core\UtilsUrl::processUrl
- Parameters
-
string | $sUrl | url to process |
int | $iLang | language id [optional] |
- See also
- \OxidEsales\Eshop\Core\UtilsUrl::processUrl
- Returns
- string
◆ resetBaseLanguage()
OxidEsales\EshopCommunity\Core\Language::resetBaseLanguage |
( |
| ) |
|
resetBaseLanguage resets base language id cache
@access public
◆ setBaseLanguage()
OxidEsales\EshopCommunity\Core\Language::setBaseLanguage |
( |
|
$iLang = null | ) |
|
Set base shop language
- Parameters
-
◆ setIsTranslated()
OxidEsales\EshopCommunity\Core\Language::setIsTranslated |
( |
|
$blIsTranslated = true | ) |
|
Set translation state
- Parameters
-
bool | $blIsTranslated | State is string translated or not. Default true. |
◆ setTplLanguage()
OxidEsales\EshopCommunity\Core\Language::setTplLanguage |
( |
|
$iLang = null | ) |
|
Validates and sets templates language id
- Parameters
-
- Returns
- null
◆ translateString()
OxidEsales\EshopCommunity\Core\Language::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 |
- Returns
- string
◆ validateLanguage()
OxidEsales\EshopCommunity\Core\Language::validateLanguage |
( |
|
$iLang = null | ) |
|
Validate language id. If not valid id, returns default value
- Parameters
-
- Returns
- int
◆ $_aActiveModuleInfo
OxidEsales\EshopCommunity\Core\Language::$_aActiveModuleInfo = null |
|
protected |
◆ $_aAdditionalLangFiles
OxidEsales\EshopCommunity\Core\Language::$_aAdditionalLangFiles = [] |
|
protected |
◆ $_aAdminTplLanguageArray
OxidEsales\EshopCommunity\Core\Language::$_aAdminTplLanguageArray = null |
|
protected |
◆ $_aDisabledModuleInfo
OxidEsales\EshopCommunity\Core\Language::$_aDisabledModuleInfo = null |
|
protected |
◆ $_aLangAbbr
OxidEsales\EshopCommunity\Core\Language::$_aLangAbbr = null |
|
protected |
◆ $_aLangCache
OxidEsales\EshopCommunity\Core\Language::$_aLangCache = [] |
|
protected |
◆ $_aLangMap
OxidEsales\EshopCommunity\Core\Language::$_aLangMap = [] |
|
protected |
◆ $_blIsTranslated
OxidEsales\EshopCommunity\Core\Language::$_blIsTranslated = true |
|
protected |
◆ $_iBaseLanguageId
OxidEsales\EshopCommunity\Core\Language::$_iBaseLanguageId = null |
|
protected |
◆ $_iEditLanguageId
OxidEsales\EshopCommunity\Core\Language::$_iEditLanguageId = null |
|
protected |
◆ $_iObjectTplLanguageId
OxidEsales\EshopCommunity\Core\Language::$_iObjectTplLanguageId = null |
|
protected |
◆ $_iTplLanguageId
OxidEsales\EshopCommunity\Core\Language::$_iTplLanguageId = null |
|
protected |
◆ $_sName
OxidEsales\EshopCommunity\Core\Language::$_sName = 'lang' |
|
protected |
◆ $moduleTranslationPathFinder
OxidEsales\EshopCommunity\Core\Language::$moduleTranslationPathFinder = null |
|
protected |
The documentation for this class was generated from the following file: