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,11 +68,15 @@ class Language{
$result = []; $result = [];
foreach($files as $file){ foreach($files as $file){
try{
$code = explode(".", $file)[0]; $code = explode(".", $file)[0];
$strings = self::loadLang($path, $code); $strings = self::loadLang($path, $code);
if(isset($strings["language.name"])){ if(isset($strings["language.name"])){
$result[$code] = $strings["language.name"]; $result[$code] = $strings["language.name"];
} }
}catch(LanguageNotFoundException $e){
// no-op
}
} }
return $result; return $result;