UserFrosting API

Dictionary extends Repository implements DictionaryInterface

Locale Dictionary.

Load all locale all "Key => translation" data matrix

Tags
author

Louis Charette

Table of Contents

$uri string
$locale LocaleInterface
$locator ResourceLocatorInterface
$fileLoader FileRepositoryLoader
$items (string|array)[]
__construct() mixed
getDictionary() Returns all loaded locale Key => Translation data dictionary. (string|array)[]
getFlattenDictionary() Return the dictionnary as a flatten array, using dot notation. string[]
setUri() Set the locator base URI (default 'locale://'). void
getLocale() Return the associate locale. LocaleInterface
getFileLoader() Return the file repository loader used to load. FileRepositoryLoader
loadDictionary() Load the dictionary from file. (string|array)[]
filterDictionaryFiles() Remove config files from locator results and convert ResourceInterface to path/string. string[]
getFiles() List all files for a given locale using the locator. \UserFrosting\UniformResourceLocator\ResourceInterface[]
mergeItems() Recursively merge values (scalar or array) into this repository. self
getDefined() Get the specified configuration value, recursively removing all null values. mixed

Properties

Methods

getDictionary()

Returns all loaded locale Key => Translation data dictionary.

public getDictionary( ) : (string|array)[]
Return values
(string|array)[]

The locale dictionary

getFlattenDictionary()

Return the dictionnary as a flatten array, using dot notation.

public getFlattenDictionary( ) : string[]
Return values
string[]

setUri()

Set the locator base URI (default 'locale://').

public setUri( $uri : string ) : void
Parameters
$uri : string

loadDictionary()

Load the dictionary from file.

protected loadDictionary( ) : (string|array)[]
Return values
(string|array)[]

The locale dictionary

filterDictionaryFiles()

Remove config files from locator results and convert ResourceInterface to path/string.

protected filterDictionaryFiles( $files : \UserFrosting\UniformResourceLocator\ResourceInterface[] ) : string[]
Parameters
$files : \UserFrosting\UniformResourceLocator\ResourceInterface[]
Return values
string[]

getFiles()

List all files for a given locale using the locator.

protected getFiles( ) : \UserFrosting\UniformResourceLocator\ResourceInterface[]
Return values
\UserFrosting\UniformResourceLocator\ResourceInterface[]

mergeItems()

Recursively merge values (scalar or array) into this repository.

public mergeItems( $key : string|null , $items : mixed ) : self

If no key is specified, the items will be merged in starting from the top level of the array. If a key IS specified, items will be merged into that key. Nested keys may be specified using dot syntax.

Parameters
$key : string|null
$items : mixed
Return values
self

getDefined()

Get the specified configuration value, recursively removing all null values.

public getDefined( [ $key : string|array|null = null ] ) : mixed
Parameters
$key : string|array|null = null
Return values
mixed

Search results