From 01266ec45907036959af87d37de5a808c324ce8e Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 27 Jul 2016 12:01:55 +0200 Subject: [PATCH] Updated Travis-CI --- lang.class.php | 10 +++++++--- test.php | 7 ++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lang.class.php b/lang.class.php index 6f561c3..45edcc9 100644 --- a/lang.class.php +++ b/lang.class.php @@ -1,5 +1,4 @@ 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; } -} \ No newline at end of file +} +?> \ No newline at end of file diff --git a/test.php b/test.php index ae0692a..1ded2bb 100644 --- a/test.php +++ b/test.php @@ -14,10 +14,7 @@ echo $lang->get('Home is where your wifi connects automatically').'
';//Get $lang->setLang('examples/lang.de_extra.php', 'de'); echo $lang->get('fail'); -echo '
';
-print_r($lang->getAll());
-echo '
'; - $lang->set('Test in english', 'test', 'en'); $lang->set('Test auf Deutsch', 'test', 'de'); -echo $lang->get('test'); \ No newline at end of file +echo $lang->get('test'); +?> \ No newline at end of file