Methods

_init()

_init() 

Deletes a (dot notated) language string

delete(string $item, string $group, string | null $language) : array | bool

Parameters

$item

string

a (dot notated) language key

$group

string

group

$language

stringnull

name of the language to set, null for the configured language

Returns

arrayboolthe \Arr::delete result, success boolean or array of success booleans

Returns a (dot notated) language string

get(string $line, array $params, mixed $default, string | null $language) : mixed

Parameters

$line

string

key for the line

$params

array

array of params to str_replace

$default

mixed

default value to return

$language

stringnull

name of the language to get, null for the configured language

Returns

mixedeither the line or default when not found

Returns currently active language.

get_lang() : string

Returns

stringcurrently active language

Loads a language file.

load(mixed $file, mixed $group, string | null $language, bool $overwrite, bool $reload) : array

Parameters

$file

mixed

string file | language array | Lang_Interface instance

$group

mixed

null for no group, true for group is filename, false for not storing in the master lang

$language

stringnull

name of the language to load, null for the configured language

$overwrite

bool

true for array_merge, false for \Arr::merge

$reload

bool

true to force a reload even if the file is already loaded

Exceptions

\FuelException

Returns

arraythe (loaded) language array

Save a language array to disk.

save(string $file, string | array $lang, string | null $language) : bool

Parameters

$file

string

desired file name

$lang

stringarray

master language array key or language array

$language

stringnull

name of the language to load, null for the configured language

Exceptions

\LangException

Returns

boolfalse when language is empty or invalid else \File::update result

Sets a (dot notated) language string

set(string $line, mixed $value, string $group, string | null $language) : void

Parameters

$line

string

a (dot notated) language key

$value

mixed

the language string

$group

string

group

$language

stringnull

name of the language to set, null for the configured language

Sets the current language, and optionally reloads all language files loaded in another language

set_lang(string $language, bool $reload) : bool

Parameters

$language

string

name of the language to activate

$reload

bool

true to force a reload of already loaded language files

Returns

boolsuccess boolean, false if no language or the current was passed, true otherwise

 Properties

 

<p>language(s) to fall back on when loading a file from the current lang fails</p>

$fallback : array

 

<p>language lines</p>

$lines : array

 

<p>array of loaded files</p>

$loaded_files : array