Project

General

Profile

« Previous | Next » 

Revision 2096

Added by darkviper over 10 years ago

+ Translate::enablePrivateTable() allows to add more private language definitions
+ Translate::disablePrivateTable()
! TranslateAdaptorWbOldStyle move hardcoded foldername into a variable

View differences:

TranslateAdaptorWbOldStyle.php
36 36
class TranslateAdaptorWbOldStyle implements TranslateAdaptorInterface {
37 37

  
38 38
	protected $sAddon     = '';
39
    protected $sTransDir  = 'languages/';
39 40
	protected $sFilePath  = '';
40 41
/**
41 42
 * Constructor
......
100 101
	private function _getAddonPath()
101 102
	{
102 103
	// set environment
103
		$sAddon   = trim(str_replace('\\', '/', $this->sAddon), '/');
104
		$sAddon   = trim(str_replace('\\', '/', $this->sAddon), '/').'/';
104 105
		$sAppDirname = str_replace('\\', '/', dirname(dirname(__FILE__))).'/';
105
		$sLanguagePath = $sAppDirname.$sAddon.'/languages/';
106
		$sLanguagePath = $sAppDirname.$sAddon.$this->sTransDir;
106 107
		if(is_dir($sLanguagePath) && is_readable($sLanguagePath)) {
107 108
		// valid directory found
108 109
			return $sLanguagePath;
......
111 112
		{
112 113
		// get used acp dirname
113 114
			$sTmp = trim(WbAdaptor::getInstance()->AcpDir, '/');
114
		// if path starts with 'admin/' then replace with used acp dirname
115
			$sLanguagePath = $sAppDirname.preg_replace('/^admin/sU', $sTmp, $sAddon).'/languages/';
115
		// if path starts with 'admin/' then replace with used real acp dirname
116
			$sLanguagePath = $sAppDirname.preg_replace('/^admin/sU', $sTmp, $sAddon).$this->sTransDir;
116 117
			if(is_dir($sLanguagePath) && is_readable($sLanguagePath)) {
117 118
			// valid directory found
118 119
				return $sLanguagePath;

Also available in: Unified diff