Skip to content

Commit

Permalink
Apply to all message
Browse files Browse the repository at this point in the history
  • Loading branch information
nnnlog committed Oct 18, 2017
1 parent c4b92bf commit 77cadfd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/pocketmine/lang/BaseLang.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ public function translateString(string $str, array $params = [], string $onlyPre
foreach($params as $i => $p){
$baseText = str_replace("{%$i}", $this->parseTranslation((string) $p), $baseText, $onlyPrefix);
}

$baseText = str_replace('\n', PHP_EOL, $baseText);

return str_replace("%0", "", $baseText); //fixes a client bug where %0 in translation will cause freeze
}
Expand All @@ -131,6 +133,8 @@ public function translate(TextContainer $c){
}else{
$baseText = $this->parseTranslation($c->getText());
}

$baseText = str_replace('\n', PHP_EOL, $baseText);

return $baseText;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pocketmine/wizard/SetupWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function run() : bool{
}

private function showLicense() : bool{
$this->message(str_replace('\n', PHP_EOL, $this->lang->get("welcome_to_pocketmine")));
$this->message($this->lang->get("welcome_to_pocketmine"));
echo <<<LICENSE
This program is free software: you can redistribute it and/or modify
Expand Down

0 comments on commit 77cadfd

Please sign in to comment.