Fix language when no custom files exist

This commit is contained in:
Josh North 2021-04-13 11:32:09 -04:00
parent 60b462465e
commit c376f8b5b0

View File

@ -36,6 +36,7 @@ class Translate {
$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);
}