Revision 1873
Added by darkviper over 11 years ago
TranslationTable.php | ||
---|---|---|
22 | 22 |
* |
23 | 23 |
* @category Core |
24 | 24 |
* @package Core_Translation |
25 |
* @copyright Werner v.d.Decken <wkl@isteam.de> |
|
25 | 26 |
* @author Werner v.d.Decken <wkl@isteam.de> |
26 |
* @copyright Werner v.d.Decken <wkl@isteam.de> |
|
27 | 27 |
* @license http://www.gnu.org/licenses/gpl.html GPL License |
28 | 28 |
* @version 0.0.1 |
29 | 29 |
* @revision $Revision$ |
... | ... | |
42 | 42 |
protected $oReg = null; |
43 | 43 |
protected $sTempPath = ''; |
44 | 44 |
protected $iDirMode = 0777; |
45 |
/** |
|
45 |
protected $bUseCache = true; |
|
46 |
|
|
47 |
/** |
|
46 | 48 |
* Constructor |
47 | 49 |
* @param string relative pathname of the Addon (i.e. '' || 'modules/myAddon/') |
48 | 50 |
* @param string System language code ( 2*3ALPHA[[_2ALPHA]_2*4ALNUM] ) |
49 | 51 |
* @param string Default language code ( 2*3ALPHA[[_2ALPHA]_2*4ALNUM] ) |
50 | 52 |
* @param string User language code ( 2*3ALPHA[[_2ALPHA]_2*4ALNUM] ) |
53 |
* @param boolean true if caching is enabled |
|
51 | 54 |
*/ |
52 | 55 |
public function __construct($sAddon, |
53 |
$sSystemLanguage, $sDefaultLanguage, $sUserLanguage, |
|
54 |
$bUseCache = Translate::CACHE_ENABLED) |
|
56 |
$sSystemLanguage, |
|
57 |
$sDefaultLanguage, |
|
58 |
$sUserLanguage, |
|
59 |
$bUseCache = true) |
|
55 | 60 |
{ |
56 | 61 |
$this->bUseCache = $bUseCache; |
57 | 62 |
$this->sSystemLang = $sSystemLanguage; |
... | ... | |
195 | 200 |
$sConcatedLang = ''; |
196 | 201 |
foreach($aLangCode as $sLang) |
197 | 202 |
{ // iterate all segments of the language code |
198 |
if( ($aResult = $oAdaptor->loadLanguage($sConcatedLang.$sLang)) !== false ) { |
|
203 |
$sConcatedLang .= ($sConcatedLang == '' ? '' : '_').$sLang; |
|
204 |
if( ($aResult = $oAdaptor->loadLanguage($sConcatedLang)) !== false ) { |
|
199 | 205 |
$aTranslations = array_merge($aTranslations, $aResult); |
200 | 206 |
} |
201 | 207 |
} |
Also available in: Unified diff
some small fixes in packet Translate
added option to disable cache
added option to keep placeholders if no translation was found