FileLoader
class FileLoader implements Loader
Properties
| protected array | $paths | The default paths for the loader. |
|
| protected array | $jsonPaths | All of the registered paths to JSON translation files. |
|
| protected array<string, string> | $hints | All of the namespace hints. |
Methods
Load the messages for the given locale.
Load a namespaced translation group.
Load a local namespaced translation group for overrides.
Load a locale from a given path.
Load a locale from the given JSON file path.
Add a new namespace to the loader.
Get an array of all the registered namespaces.
Add a new path to the loader.
Add a new JSON path to the loader.
Get an array of all the registered paths to translation files.
Get an array of all the registered paths to JSON translation files.
Details
at line 37
__construct(Filesystem $files, array|string $path)
Create a new file loader instance.
at line 47
array
load(string $locale, string $group, string|null $namespace = null)
Load the messages for the given locale.
at line 75
protected array
loadNamespaced(string $locale, string $group, string $namespace)
Load a namespaced translation group.
at line 89
protected array
loadNamespaceOverrides(array $lines, string $locale, string $group, string $namespace)
Load a local namespaced translation group for overrides.
at line 106
protected array
loadPaths(array $paths, string $locale, string $group)
Load a locale from a given path.
at line 123
protected array
loadJsonPaths(string $locale)
Load a locale from the given JSON file path.
at line 155
void
addNamespace(string $namespace, string $hint)
Add a new namespace to the loader.
On the shared loader, the namespace affects every subsequent translation lookup in the worker.
at line 166
array
namespaces()
Get an array of all the registered namespaces.
at line 177
void
addPath(string $path)
Add a new path to the loader.
On the shared loader, the path affects every subsequent translation lookup in the worker.
at line 189
void
addJsonPath(string $path)
Add a new JSON path to the loader.
On the shared loader, the path affects every subsequent translation lookup in the worker.
at line 198
array
paths()
Get an array of all the registered paths to translation files.
at line 206
array
jsonPaths()
Get an array of all the registered paths to JSON translation files.