Skip to content

Language ​

class · pocketmine\lang\Language · source

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 $langName

Methods ​

__construct() ​

php
public function __construct(string $lang, ?string $path = null, string $fallback = self::FALLBACK_LANGUAGE)

get() ​

php
public function get(string $id) : string

getAll() ​

php
public function getAll() : array

getLang() ​

php
public function getLang() : string

getLanguageList() ​

php
public static function getLanguageList(string $path = "") : array

getName() ​

php
public function getName() : string

internalGet() protected ​

php
protected function internalGet(string $id) : ?string

loadLang() protected ​

php
protected static function loadLang(string $path, string $languageCode) : array

parseTranslation() protected ​

php
protected function parseTranslation(string $text, ?string $onlyPrefix = null, int &$parameterCount = 0) : string

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.

translate() ​

php
public function translate(\pocketmine\lang\Translatable $c) : string

translateString() ​

php
public function translateString(string $str, array $params = [], ?string $onlyPrefix = null, int &$untranslatedParameterCount = 0) : string

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.