diff --git a/index.php b/index.php index 0e6cee6..7332e30 100644 --- a/index.php +++ b/index.php @@ -257,7 +257,7 @@ if (Registry::AUTHMETHOD == 'SAML') {
-
 
+
 

diff --git a/src/Language/Translate.php b/src/Language/Translate.php index 5db257e..5a72c35 100644 --- a/src/Language/Translate.php +++ b/src/Language/Translate.php @@ -26,23 +26,19 @@ use App\LobbySIO\Config\Registry; * @author josh.north */ class Translate { - - private $UserLng; - private $langSelected; - public $lang = array(); - public function __construct($userLanguage){ - $this->UserLng = $userLanguage; - //construct lang file - $langFile = Registry::DIRPATH . 'src/Language/'. $this->UserLng . '.lang.ini'; - if(!file_exists($langFile)){ - //throw new \Exception("Language could not be loaded"); //or default to a language - $langFile = Registry::DIRPATH . 'src/Language/'. $this->UserLng . '.lang.ini.example'; - } - $this->lang = parse_ini_file($langFile); - } - public function userLanguage(){ - return $this->lang; - } - + private $UserLng; + private $langSelected; + public $lang = array(); + public function __construct($userLanguage){ + $this->UserLng = $userLanguage; + if(file_exists(Registry::DIRPATH . 'src/Language/'. $this->UserLng . '.lang.ini.example')){ $example = parse_ini_file(Registry::DIRPATH . 'src/Language/'. $this->UserLng . '.lang.ini.example'); }; + if(file_exists(Registry::DIRPATH . 'src/Language/'. $this->UserLng . '.lang.ini')){ $custom = parse_ini_file(Registry::DIRPATH . 'src/Language/'. $this->UserLng . '.lang.ini'); }; + if(isset($example)&&isset($custom)){$this->lang = array_merge($example,$custom);} + elseif(!isset($custom)){$this->lang = array_merge($example);} + elseif(!isset($example)){$this->lang = array_merge($custom);} + } + public function userLanguage(){ + return $this->lang; + } } diff --git a/src/Language/en.lang.ini.example b/src/Language/en.lang.ini.example index 178d193..9b596c7 100644 --- a/src/Language/en.lang.ini.example +++ b/src/Language/en.lang.ini.example @@ -1,3 +1,4 @@ +TTTT = 'TESTTESTTESTTEST' ACCESS_LEVEL = 'Access' ACCOUNT = 'Account' ACCOUNT_INFO_DESC = 'You may make changes to your user profile below. To change your password, enter a new password twice below and press save. Minimum password length is '