class FileLoader implements LoaderInterface

Properties

protected Filesystem $files

The filesystem instance.

protected string $path

The default path for the loader.

protected array $hints

All of the namespace hints.

Methods

void
__construct(Filesystem $files, string $path)

Create a new file loader instance.

array
load(string $locale, string $group, string $namespace = null)

Load the messages for the given locale.

array
loadNamespaced(string $locale, string $group, string $namespace)

Load a namespaced translation group.

array
loadNamespaceOverrides(array $lines, string $locale, string $group, string $namespace)

Load a local namespaced translation group for overrides.

array
loadPath(string $path, string $locale, string $group)

Load a locale from a given path.

array
loadJsonPath(string $path, string $locale)

Load a locale from the given JSON file path.

void
addNamespace(string $namespace, string $hint)

Add a new namespace to the loader.

array
namespaces()

Get an array of all the registered namespaces.

Details

at line 37
void __construct(Filesystem $files, string $path)

Create a new file loader instance.

Parameters

Filesystem $files
string $path

Return Value

void

at line 51
array load(string $locale, string $group, string $namespace = null)

Load the messages for the given locale.

Parameters

string $locale
string $group
string $namespace

Return Value

array

at line 72
protected array loadNamespaced(string $locale, string $group, string $namespace)

Load a namespaced translation group.

Parameters

string $locale
string $group
string $namespace

Return Value

array

at line 92
protected array loadNamespaceOverrides(array $lines, string $locale, string $group, string $namespace)

Load a local namespaced translation group for overrides.

Parameters

array $lines
string $locale
string $group
string $namespace

Return Value

array

at line 111
protected array loadPath(string $path, string $locale, string $group)

Load a locale from a given path.

Parameters

string $path
string $locale
string $group

Return Value

array

at line 127
protected array loadJsonPath(string $path, string $locale)

Load a locale from the given JSON file path.

Parameters

string $path
string $locale

Return Value

array

at line 143
void addNamespace(string $namespace, string $hint)

Add a new namespace to the loader.

Parameters

string $namespace
string $hint

Return Value

void

at line 153
array namespaces()

Get an array of all the registered namespaces.

Return Value

array