mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Language: document poorly-named function parseTranslation()
This commit is contained in:
parent
4a3d9f8f83
commit
d4b8c47a65
@ -183,6 +183,19 @@ class Language{
|
||||
return $this->lang;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces translation keys embedded inside a string with their raw values.
|
||||
* Embedded translation keys must be prefixed by a "%" character.
|
||||
*
|
||||
* This is used to allow the "text" field of a Translatable to contain formatting (e.g. colour codes) and
|
||||
* multiple embedded translation keys.
|
||||
*
|
||||
* Normal translations whose "text" is just a single translation key don't need to use this method, and can be
|
||||
* processed via get() directly.
|
||||
*
|
||||
* @param string|null $onlyPrefix If non-null, only translation keys with this prefix will be replaced. This is
|
||||
* used to allow a client to do its own translating of vanilla strings.
|
||||
*/
|
||||
protected function parseTranslation(string $text, ?string $onlyPrefix = null) : string{
|
||||
$newString = "";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user