mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
parent
e2bae92df8
commit
e9963b603d
@ -2447,7 +2447,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
$message = $message->getText();
|
$message = $message->getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
$mes = explode("\n", $this->server->getLanguage()->translateString($message, [], "pocketmine."));
|
$mes = explode("\n", $this->server->getLanguage()->translateString($message));
|
||||||
foreach($mes as $m){
|
foreach($mes as $m){
|
||||||
if($m !== ""){
|
if($m !== ""){
|
||||||
$pk = new TextPacket();
|
$pk = new TextPacket();
|
||||||
|
@ -86,7 +86,7 @@ class BaseLang{
|
|||||||
*/
|
*/
|
||||||
public function translateString($str, array $params = [], $onlyPrefix = null){
|
public function translateString($str, array $params = [], $onlyPrefix = null){
|
||||||
$baseText = $this->get($str);
|
$baseText = $this->get($str);
|
||||||
$baseText = $this->parseTranslation( $baseText !== null ? $baseText : $str, $onlyPrefix);
|
$baseText = $this->parseTranslation( ($baseText !== null and ($onlyPrefix === null or strpos($str, $onlyPrefix) === 0)) ? $baseText : $str, $onlyPrefix);
|
||||||
|
|
||||||
foreach($params as $i => $p){
|
foreach($params as $i => $p){
|
||||||
$baseText = str_replace("{%$i}", $this->parseTranslation((string) $p), $baseText, $onlyPrefix);
|
$baseText = str_replace("{%$i}", $this->parseTranslation((string) $p), $baseText, $onlyPrefix);
|
||||||
@ -164,7 +164,7 @@ class BaseLang{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($replaceString !== null){
|
if($replaceString !== null){
|
||||||
if(($t = $this->internalGet(substr($replaceString, 1)))){
|
if(($t = $this->internalGet(substr($replaceString, 1))) !== null and ($onlyPrefix === null or strpos($replaceString, $onlyPrefix) === 1)){
|
||||||
$newString .= $t;
|
$newString .= $t;
|
||||||
}else{
|
}else{
|
||||||
$newString .= $replaceString;
|
$newString .= $replaceString;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user