Updated language files and command descriptions

This commit is contained in:
Shoghi Cervantes
2015-04-12 00:59:12 +02:00
parent 8d468a1efb
commit e2bae92df8
42 changed files with 91 additions and 74 deletions

View File

@ -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;