mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
Language: treat empty translation files the same as missing ones
This commit is contained in:
parent
fb25e05416
commit
456439566b
@ -27,6 +27,7 @@ use pocketmine\utils\Utils;
|
||||
use Webmozart\PathUtil\Path;
|
||||
use function array_filter;
|
||||
use function array_map;
|
||||
use function count;
|
||||
use function explode;
|
||||
use function file_exists;
|
||||
use function is_dir;
|
||||
@ -124,7 +125,10 @@ class Language{
|
||||
protected static function loadLang(string $path, string $languageCode) : array{
|
||||
$file = Path::join($path, $languageCode . ".ini");
|
||||
if(file_exists($file)){
|
||||
return array_map('\stripcslashes', Utils::assumeNotFalse(parse_ini_file($file, false, INI_SCANNER_RAW), "Missing or inaccessible required resource files"));
|
||||
$strings = array_map('\stripcslashes', Utils::assumeNotFalse(parse_ini_file($file, false, INI_SCANNER_RAW), "Missing or inaccessible required resource files"));
|
||||
if(count($strings) > 0){
|
||||
return $strings;
|
||||
}
|
||||
}
|
||||
|
||||
throw new LanguageNotFoundException("Language \"$languageCode\" not found");
|
||||
|
Loading…
x
Reference in New Issue
Block a user