Updated Travis-CI

This commit is contained in:
kolaente 2016-07-27 12:01:55 +02:00
parent bb651db1c1
commit 01266ec459
2 changed files with 9 additions and 8 deletions

View File

@ -1,5 +1,4 @@
<?php
class lang
{
private $lang;
@ -10,7 +9,11 @@ class lang
function __construct($default = 'en')
{
$this->default = $default;
$this->lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
$this->lang = 'en';
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
{
$this->lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
}
$this->langfiles = [];
}
@ -123,4 +126,5 @@ class lang
{
$this->langfiles[$lang]['langstrings'][$identifier] = $string;
}
}
}
?>

View File

@ -14,10 +14,7 @@ echo $lang->get('Home is where your wifi connects automatically').'<br/>';//Get
$lang->setLang('examples/lang.de_extra.php', 'de');
echo $lang->get('fail');
echo '<pre>';
print_r($lang->getAll());
echo '</pre>';
$lang->set('Test in english', 'test', 'en');
$lang->set('Test auf Deutsch', 'test', 'de');
echo $lang->get('test');
echo $lang->get('test');
?>