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