Vergleich inc/class_language.php - 1.6.10 - 1.6.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: class_language.php 5828 2012-05-08 16:06:16Z Tomm $

 * $Id$

 */

class MyLanguage

 */

class MyLanguage

Zeile 25Zeile 25
	 * @var string
*/
public $language;

	 * @var string
*/
public $language;

 

/**
* The fallback language we are using.
*
* @var string
*/
public $fallback = 'english';


/**
* Information about the current language.


/**
* Information about the current language.

Zeile 70Zeile 77
	 */
function set_language($language="english", $area="user")
{

	 */
function set_language($language="english", $area="user")
{

		global $mybb;

		global $settings;

		
$language = preg_replace("#[^a-z0-9\-_]#i", "", $language);


		
$language = preg_replace("#[^a-z0-9\-_]#i", "", $language);


Zeile 95Zeile 102
		{
if(!is_dir($this->path."/".$language."/{$area}"))
{

		{
if(!is_dir($this->path."/".$language."/{$area}"))
{

				if(!is_dir($this->path."/".$mybb->settings['cplanguage']."/{$area}"))

				if(!is_dir($this->path."/".$settings['cplanguage']."/{$area}"))

				{
if(!is_dir($this->path."/english/{$area}"))
{

				{
if(!is_dir($this->path."/english/{$area}"))
{

Zeile 108Zeile 115
				}
else
{

				}
else
{

					$language = $mybb->settings['cplanguage'];

					$language = $settings['cplanguage'];

				}
}
$this->language = $language."/{$area}";

				}
}
$this->language = $language."/{$area}";

 
			$this->fallback = $this->fallback."/{$area}";

		}
}


		}
}


Zeile 126Zeile 134
	{
// Assign language variables.
// Datahandlers are never in admin lang directory.

	{
// Assign language variables.
// Datahandlers are never in admin lang directory.

		if($isdatahandler === true)

		if($isdatahandler)

		{

		{

			$this->language = str_replace('/admin', '', $this->language);





			$lfile = $this->path.'/'.str_replace('/admin', '', $this->language).'/'.$section.'.lang.php';
}
else
{
$lfile = $this->path.'/'.$this->language.'/'.$section.'.lang.php';

		}

		}

		$lfile = $this->path."/".$this->language."/".$section.".lang.php";

 
		
if(file_exists($lfile))
{
require_once $lfile;
}

		
if(file_exists($lfile))
{
require_once $lfile;
}

		elseif(file_exists($this->path."/english/".$section.".lang.php"))

		elseif(file_exists($this->path."/".$this->fallback."/".$section.".lang.php"))

		{

		{

			require_once $this->path."/english/".$section.".lang.php";

			require_once $this->path."/".$this->fallback."/".$section.".lang.php";

		}
else
{

		}
else
{

Zeile 210Zeile 221
	 */
function parse($contents)
{

	 */
function parse($contents)
{

		$contents = preg_replace("#<lang:([a-zA-Z0-9_]+)>#e", "\$this->$1", $contents);

		$contents = preg_replace_callback("#<lang:([a-zA-Z0-9_]+)>#", array($this, 'parse_replace'), $contents);

		return $contents;

		return $contents;

 
	}

/**
* Replace content with language variable.
*
* @param array Matches.
* @return string Language variable.
*/
function parse_replace($matches)
{
return $this->$matches[1];

	}
}
?>

	}
}
?>