Documentation

Language
in package

Table of Contents

FALLBACK_LANGUAGE  = "eng"
$fallbackLang  : array<string|int, string>
$lang  : array<string|int, string>
$langName  : string
__construct()  : mixed
get()  : string
getLang()  : string
getLanguageList()  : array<string|int, string>
getName()  : string
translate()  : string
translateString()  : string
internalGet()  : string|null
loadLang()  : array<string|int, string>
parseTranslation()  : string

Constants

FALLBACK_LANGUAGE

public mixed FALLBACK_LANGUAGE = "eng"

Properties

$fallbackLang

protected array<string|int, string> $fallbackLang = []
Tags
phpstan-var

array<string, string>

$lang

protected array<string|int, string> $lang = []
Tags
phpstan-var

array<string, string>

Methods

__construct()

public __construct(string $lang[, string|null $path = null ][, string $fallback = self::FALLBACK_LANGUAGE ]) : mixed
Parameters
$lang : string
$path : string|null = null
$fallback : string = self::FALLBACK_LANGUAGE
Tags
throws
LanguageNotFoundException
Return values
mixed

get()

public get(string $id) : string
Parameters
$id : string
Return values
string

getLang()

public getLang() : string
Return values
string

getLanguageList()

public static getLanguageList([string $path = "" ]) : array<string|int, string>
Parameters
$path : string = ""
Tags
phpstan-return

array<string, string>

throws
LanguageNotFoundException
Return values
array<string|int, string>

getName()

public getName() : string
Return values
string

translateString()

public translateString(string $str[, array<string|int, float|int|string|\pocketmine\lang\Translatable> $params = [] ][, string|null $onlyPrefix = null ]) : string
Parameters
$str : string
$params : array<string|int, float|int|string|\pocketmine\lang\Translatable> = []
$onlyPrefix : string|null = null
Return values
string

internalGet()

protected internalGet(string $id) : string|null
Parameters
$id : string
Return values
string|null

loadLang()

protected static loadLang(string $path, string $languageCode) : array<string|int, string>
Parameters
$path : string
$languageCode : string
Tags
phpstan-return

array<string, string>

Return values
array<string|int, string>

parseTranslation()

protected parseTranslation(string $text[, string|null $onlyPrefix = null ]) : string
Parameters
$text : string
$onlyPrefix : string|null = null
Return values
string

Search results