class Translator extends Translator

Class Translator.

Properties

protected Filesystem $files

Methods

__construct(Loader $loader, string $locale, Filesystem $files)

Translator constructor.

void
addLines(array $lines, string $locale, string $namespace = '*')

Add translation lines to the given locale.

array
fetch(string $local)

Fetch all language line from a local.

string|array|null
getLine(string $namespace, string $group, string $locale, string $item, array $replace)

Retrieve a language line out the loaded array.

void
load(string $namespace, string $group, string $locale)

Load the specified language group.

bool
isLoaded(string $namespace, string $group, string $locale)

Determine if the given group has been loaded.

Details

at line 29
__construct(Loader $loader, string $locale, Filesystem $files)

Translator constructor.

Parameters

Loader $loader loader
string $locale locale
Filesystem $files files

at line 42
void addLines(array $lines, string $locale, string $namespace = '*')

Add translation lines to the given locale.

Parameters

array $lines line
string $locale locale
string $namespace namespace

Return Value

void

at line 56
array fetch(string $local)

Fetch all language line from a local.

Parameters

string $local local

Return Value

array

at line 103
protected string|array|null getLine(string $namespace, string $group, string $locale, string $item, array $replace)

Retrieve a language line out the loaded array.

Parameters

string $namespace namespace
string $group group
string $locale locale
string $item item
array $replace replace

Return Value

string|array|null

at line 125
void load(string $namespace, string $group, string $locale)

Load the specified language group.

Parameters

string $namespace namespace
string $group group
string $locale locale

Return Value

void

at line 142
protected bool isLoaded(string $namespace, string $group, string $locale)

Determine if the given group has been loaded.

Parameters

string $namespace namespace
string $group group
string $locale locale

Return Value

bool