Language
Constants
FALLBACK_LANGUAGE
php
public const FALLBACK_LANGUAGE = "eng"Properties
$fallbackLang protected
php
protected array $fallbackLang$lang protected
php
protected array $lang$langName protected
php
protected string $langNameMethods
__construct()
php
public function __construct(string $lang, ?string $path = null, string $fallback = self::FALLBACK_LANGUAGE)get()
php
public function get(string $id) : stringgetAll()
php
public function getAll() : arraygetLang()
php
public function getLang() : stringgetLanguageList()
php
public static function getLanguageList(string $path = "") : arraygetName()
php
public function getName() : stringinternalGet() protected
php
protected function internalGet(string $id) : ?stringloadLang() protected
php
protected static function loadLang(string $path, string $languageCode) : arrayparseTranslation() protected
php
protected function parseTranslation(string $text, ?string $onlyPrefix = null, int &$parameterCount = 0) : stringReplaces 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.
translate()
php
public function translate(\pocketmine\lang\Translatable $c) : stringtranslateString()
php
public function translateString(string $str, array $params = [], ?string $onlyPrefix = null, int &$untranslatedParameterCount = 0) : string