Vergleich inc/class_language.php - 1.8.20 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 8Zeile 8
 *
*/


 *
*/


 
#[AllowDynamicProperties]

class MyLanguage
{


class MyLanguage
{


Zeile 19Zeile 20
	public $path;

/**

	public $path;

/**

	 * The language we are using.



	 * The language we are using and the area (if admin).
*
* For example 'english' or 'english/admin'.

	 *
* @var string
*/
public $language;

/**

	 *
* @var string
*/
public $language;

/**

	 * The fallback language we are using.










	 * The fallback language we are using and the area (if admin).
*
* For example 'english' or 'english/admin'.
*
* @var string
*/
public $fallback = 'english';

/**
* The fallback language we are using.

	 *
* @var string

	 *
* @var string

	 */
public $fallback = 'english';

	 */
public $fallbackLanguage = 'english';


/**
* Information about the current language.


/**
* Information about the current language.

Zeile 38Zeile 50
	 * @var array
*/
public $settings;

	 * @var array
*/
public $settings;


/**


/**

	 * Set the path for the language folder.
*
* @param string $path The path to the language folder.

	 * Set the path for the language folder.
*
* @param string $path The path to the language folder.

Zeile 65Zeile 77
		else
{
return false;

		else
{
return false;

		}
}

		}
}


/**
* Set the language for an area.


/**
* Set the language for an area.

Zeile 79Zeile 91
		global $mybb;

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

		global $mybb;

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





		// Use the board's default language
if($language == "")
{

		// Use the board's default language
if($language == "")
{

Zeile 106Zeile 118
					if(!is_dir($this->path."/english/{$area}"))
{
die("Your forum does not contain an Administration set. Please reupload the english language administration pack.");

					if(!is_dir($this->path."/english/{$area}"))
{
die("Your forum does not contain an Administration set. Please reupload the english language administration pack.");

					}

					}

					else
{
$language = "english";

					else
{
$language = "english";

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

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

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

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

		}
}


		}
}


Zeile 126Zeile 138
	 * Load the language variables for a section.
*
* @param string $section The section name.

	 * Load the language variables for a section.
*
* @param string $section The section name.

	 * @param boolean $isdatahandler Is this a datahandler?

	 * @param boolean $forceuserarea Should use the user area even if in admin? For example for datahandlers

	 * @param boolean $supress_error supress the error if the file doesn't exist?
*/

	 * @param boolean $supress_error supress the error if the file doesn't exist?
*/

	function load($section, $isdatahandler=false, $supress_error=false)

	function load($section, $forceuserarea=false, $supress_error=false)

	{

	{

		// Assign language variables.
// Datahandlers are never in admin lang directory.
if($isdatahandler === true)


		$language = $this->language;
$fallback = $this->fallback;

if($forceuserarea === true)

		{

		{

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

			$language = str_replace('/admin', '', $language);
$fallback = str_replace('/admin', '', $fallback);




		}

		}

 

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


if(file_exists($lfile))
{


if(file_exists($lfile))
{

			require_once $lfile;

			require $lfile;

		}

		}

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

		elseif(file_exists($ffile))

		{

		{

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

			require $ffile;

		}
else
{

		}
else
{

Zeile 159Zeile 172
		}

// We must unite and protect our language variables!

		}

// We must unite and protect our language variables!

		$lang_keys_ignore = array('language', 'path', 'settings');

		$lang_keys_ignore = array('language', 'fallback', 'fallbackLanguage', 'path', 'settings');


if(isset($l) && is_array($l))
{


if(isset($l) && is_array($l))
{