Fixed languages-not-found bug (#5272)

* Fixed languages-not-found bug

* Update Language.php

Co-authored-by: Dylan T <odigiman@gmail.com>
This commit is contained in:
DiamondStrider1 2022-09-01 21:51:31 -05:00 committed by GitHub
parent b7a15b6e01
commit 9e0b4621be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,10 +68,14 @@ class Language{
$result = [];
foreach($files as $file){
$code = explode(".", $file)[0];
$strings = self::loadLang($path, $code);
if(isset($strings["language.name"])){
$result[$code] = $strings["language.name"];
try{
$code = explode(".", $file)[0];
$strings = self::loadLang($path, $code);
if(isset($strings["language.name"])){
$result[$code] = $strings["language.name"];
}
}catch(LanguageNotFoundException $e){
// no-op
}
}