mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Updated language files and command descriptions
This commit is contained in:
@ -84,12 +84,12 @@ class BaseLang{
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function translateString($str, array $params = []){
|
||||
public function translateString($str, array $params = [], $onlyPrefix = null){
|
||||
$baseText = $this->get($str);
|
||||
$baseText = $this->parseTranslation( $baseText !== null ? $baseText : $str);
|
||||
$baseText = $this->parseTranslation( $baseText !== null ? $baseText : $str, $onlyPrefix);
|
||||
|
||||
foreach($params as $i => $p){
|
||||
$baseText = str_replace("{%$i}", $this->parseTranslation((string) $p), $baseText);
|
||||
$baseText = str_replace("{%$i}", $this->parseTranslation((string) $p), $baseText, $onlyPrefix);
|
||||
}
|
||||
|
||||
return $baseText;
|
||||
@ -131,7 +131,7 @@ class BaseLang{
|
||||
return $id;
|
||||
}
|
||||
|
||||
protected function parseTranslation($text){
|
||||
protected function parseTranslation($text, $onlyPrefix = null){
|
||||
$newString = "";
|
||||
|
||||
$replaceString = null;
|
||||
@ -143,7 +143,7 @@ class BaseLang{
|
||||
if((ord($c) >= 0x30 and ord($c) <= 0x39) or (ord($c) >= 0x41 and ord($c) <= 0x5a) or (ord($c) >= 0x61 and ord($c) <= 0x7a) or $c === "."){
|
||||
$replaceString .= $c;
|
||||
}else{
|
||||
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;
|
||||
}else{
|
||||
$newString .= $replaceString;
|
||||
|
Submodule src/pocketmine/lang/locale updated: 6327ab744e...6212b5a945
Reference in New Issue
Block a user