Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
/**
*
*
* @access private
* @return void
*/
private function loadLanguage()
{
$lang = array();
foreach($this->_LangPath as $path)
{
$file = ROOT.DS.$path.DS.$this->getLanguage().'.php';
if(!file_exists($file))
{
throw new Exception("File was not found by searching path: $file!");
}
include($file);
$this->_LangTags = array_merge($this->_LangTags, $lang);
}
}
<?php
$lang = array(
'SOMETHING_STUPID' => 'foobar',
'ANOTHER_TRASH' => 'baz'
);
// etlicher anderer Müll...
$lang = "de";
/**
* Short Description....
*
* Long Description.....
* .......
*
* @access public
* @param string $path
* @throws Exception
* @return void
*/
public function setPath($path)
{
$path = preg_replace(
array(
'!([\\\/]+?)!',
'!([\\\/]+?)(\.+)!'
),
array(
DS,
''
),
str_replace(
ROOT,
'',
rtrim(
$path,
'/\\'
)
)
);
if(is_dir(ROOT.DS.$path))
{
if(!array_key_exists($path, $this->_LangPath))
{
array_push($this->_LangPath, $path);
}
}
else
{
throw new Exception( $path . "does not exists!" );
}
}
/**
*
*
* @access private
* @return void
*/
private function loadLanguage()
{
$lang = array();
foreach($this->_LangPath as $path)
{
$file = ROOT.DS.$path.DS.$this->getLanguage().'.php';
if(!file_exists($file))
{
throw new Exception("File was not found by searching path: $file!");
}
include($file);
if(!is_array($lang))
{
throw new Exception("Something went wrong by loading $file no array was found!");
}
$this->_LangTags = array_merge($this->_LangTags, $lang);
}
}