PHP Class Neos\Flow\I18n\Configuration

ファイルを表示 Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$currentLocale Locale
$defaultLocale Locale
$fallbackRule array

Public Methods

Method Description
__construct ( string $defaultLocaleIdentifier ) Constructs a new configuration object with the given locale identifier to be used as the default locale of this configuration.
getCurrentLocale ( ) : Locale Returns the current locale. This is the default locale if no current locale has been set or the set current locale has a language code of "mul".
getDefaultLocale ( ) : Locale Returns the default locale of this configuration.
getFallbackRule ( ) : array Returns the current fallback rule.
setCurrentLocale ( Locale $locale ) : void Sets the current locale of this configuration.
setFallbackRule ( array $fallbackRule ) Allows to set a fallback order for locale resolving. If not set, the implicit inheritance of locales will be used. That is, if a locale of en_UK is requested, matches will be searched for in en_UK and en before trying the default locale configured in Flow.

Method Details

__construct() public method

Constructs a new configuration object with the given locale identifier to be used as the default locale of this configuration.
public __construct ( string $defaultLocaleIdentifier )
$defaultLocaleIdentifier string

getCurrentLocale() public method

Returns the current locale. This is the default locale if no current locale has been set or the set current locale has a language code of "mul".
public getCurrentLocale ( ) : Locale
return Locale

getDefaultLocale() public method

Returns the default locale of this configuration.
public getDefaultLocale ( ) : Locale
return Locale

getFallbackRule() public method

Returns the current fallback rule.
See also: setFallbackRule()
public getFallbackRule ( ) : array
return array

setCurrentLocale() public method

Sets the current locale of this configuration.
public setCurrentLocale ( Locale $locale ) : void
$locale Locale
return void

setFallbackRule() public method

If this is given an order of [dk, za, fr_CA] a request for en_UK will be looked up in en_UK, en, dk, za, fr_CA, fr before trying the default locale. If strict flag is given in the array, the above example would instead look in en_UK, dk, za, fr_CA before trying the default locale. In other words, the implicit fallback is not applied to the locales in the fallback rule. Here is an example: array('strict' => FALSE, 'order' => array('dk', 'za'))
public setFallbackRule ( array $fallbackRule )
$fallbackRule array

Property Details

$currentLocale protected_oe property

protected Locale,Neos\Flow\I18n $currentLocale
return Locale

$defaultLocale protected_oe property

protected Locale,Neos\Flow\I18n $defaultLocale
return Locale

$fallbackRule protected_oe property

protected array $fallbackRule
return array