Documentation

FileLoader
in package
implements Loader

Interfaces, Classes and Traits

Loader

Table of Contents

$files  : Filesystem
The filesystem instance.
$hints  : array<string|int, mixed>
All of the namespace hints.
$jsonPaths  : string
All of the registered paths to JSON translation files.
$path  : string
The default path for the loader.
__construct()  : void
Create a new file loader instance.
addJsonPath()  : void
Add a new JSON path to the loader.
addNamespace()  : void
Add a new namespace to the loader.
load()  : array<string|int, mixed>
Load the messages for the given locale.
namespaces()  : array<string|int, mixed>
Get an array of all the registered namespaces.
loadJsonPaths()  : array<string|int, mixed>
Load a locale from the given JSON file path.
loadNamespaced()  : array<string|int, mixed>
Load a namespaced translation group.
loadNamespaceOverrides()  : array<string|int, mixed>
Load a local namespaced translation group for overrides.
loadPath()  : array<string|int, mixed>
Load a locale from a given path.

Properties

$hints

All of the namespace hints.

protected array<string|int, mixed> $hints = []

$jsonPaths

All of the registered paths to JSON translation files.

protected string $jsonPaths = []

$path

The default path for the loader.

protected string $path

Methods

__construct()

Create a new file loader instance.

public __construct(Filesystem $files, string $path) : void
Parameters
$files : Filesystem
$path : string
Return values
void

addJsonPath()

Add a new JSON path to the loader.

public addJsonPath(string $path) : void
Parameters
$path : string
Return values
void

addNamespace()

Add a new namespace to the loader.

public addNamespace(string $namespace, string $hint) : void
Parameters
$namespace : string
$hint : string
Return values
void

load()

Load the messages for the given locale.

public load(string $locale, string $group[, string $namespace = null ]) : array<string|int, mixed>
Parameters
$locale : string
$group : string
$namespace : string = null
Return values
array<string|int, mixed>

namespaces()

Get an array of all the registered namespaces.

public namespaces() : array<string|int, mixed>
Return values
array<string|int, mixed>

loadJsonPaths()

Load a locale from the given JSON file path.

protected loadJsonPaths(string $locale) : array<string|int, mixed>
Parameters
$locale : string
Tags
throws
RuntimeException
Return values
array<string|int, mixed>

loadNamespaced()

Load a namespaced translation group.

protected loadNamespaced(string $locale, string $group, string $namespace) : array<string|int, mixed>
Parameters
$locale : string
$group : string
$namespace : string
Return values
array<string|int, mixed>

loadNamespaceOverrides()

Load a local namespaced translation group for overrides.

protected loadNamespaceOverrides(array<string|int, mixed> $lines, string $locale, string $group, string $namespace) : array<string|int, mixed>
Parameters
$lines : array<string|int, mixed>
$locale : string
$group : string
$namespace : string
Return values
array<string|int, mixed>

loadPath()

Load a locale from a given path.

protected loadPath(string $path, string $locale, string $group) : array<string|int, mixed>
Parameters
$path : string
$locale : string
$group : string
Return values
array<string|int, mixed>

Search results