Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
Fixed #1969
Browse files Browse the repository at this point in the history
  • Loading branch information
shoghicp committed Nov 18, 2014
1 parent ca9fe1b commit 19c0302
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/pocketmine/wizard/InstallerLang.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,18 @@ public function __construct($lang = ""){
$this->lang = $lang;
$this->langfile = \pocketmine\PATH . "src/pocketmine/lang/Installer/" . $lang . ".ini";
}else{
$l = glob(\pocketmine\PATH . "src/pocketmine/lang/Installer/" . $lang . "_*.ini");
if(count($l) > 0){
$files = [];
foreach($l as $file){
$files[$file] = filesize($file);
$files = [];
foreach(new \DirectoryIterator(\pocketmine\PATH . "src/pocketmine/lang/Installer/") as $file){
if($file->getExtension() === "ini"){
$files[$file->getFilename()] = $file->getSize();
}
}

if(count($files) > 0){
arsort($files);
reset($files);
$l = key($files);
$l = substr($l, strrpos($l, "/") + 1, -4);
$l = substr($l, 0, -4);
$this->lang = isset(self::$languages[$l]) ? $l : $lang;
$this->langfile = \pocketmine\PATH . "src/pocketmine/lang/Installer/" . $l . ".ini";
}else{
Expand Down

0 comments on commit 19c0302

Please sign in to comment.