mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Language: Attempt to treat parameters as translation keys, even if they don't have %prefixes
%prefixes should only be necessary for embedded translations where the key isn't at the start of the string. Longer term we should just drop raw string translation entirely and just translate Translatables exclusively, but this is a stepping stone.
This commit is contained in:
parent
1aa541aefe
commit
39cdf23bd5
@ -137,7 +137,7 @@ class Language{
|
||||
$baseText = $this->parseTranslation(($onlyPrefix === null or strpos($str, $onlyPrefix) === 0) ? $baseText : $str, $onlyPrefix);
|
||||
|
||||
foreach($params as $i => $p){
|
||||
$replacement = $p instanceof Translatable ? $this->translate($p) : $this->parseTranslation((string) $p);
|
||||
$replacement = $p instanceof Translatable ? $this->translate($p) : $this->internalGet((string) $p) ?? $this->parseTranslation((string) $p);
|
||||
$baseText = str_replace("{%$i}", $replacement, $baseText);
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ class Language{
|
||||
$baseText = $this->parseTranslation($baseText ?? $c->getText());
|
||||
|
||||
foreach($c->getParameters() as $i => $p){
|
||||
$replacement = $p instanceof Translatable ? $this->translate($p) : $this->parseTranslation($p);
|
||||
$replacement = $p instanceof Translatable ? $this->translate($p) : $this->internalGet($p) ?? $this->parseTranslation($p);
|
||||
$baseText = str_replace("{%$i}", $replacement, $baseText);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user