LocaleSettings
in package
VuFind Locale Settings
Tags
Table of Contents
- $browserDetectLanguage : bool
- Should we use auto-detect language based on browser settings?
- $defaultLocale : string
- Default locale (code)
- $enabledLocales : array<string|int, mixed>
- Associative (code => description) array of enabled locales.
- $fallbackLocales : array<string|int, string>
- Prioritized array of locales to use when strings are missing from the primary language file.
- $initializedLocales : array<string|int, string>
- Array of locales that have been initialized.
- $rightToLeftLocales : array<string|int, string>
- Array of locales that use right-to-left formatting.
- __construct() : mixed
- Constructor
- browserLanguageDetectionEnabled() : bool
- Should we use auto-detect language based on browser settings?
- getDefaultLocale() : string
- Get default locale.
- getEnabledLocales() : array<string|int, mixed>
- Get an associative (code => description) array of enabled locales.
- getFallbackLocales() : array<string|int, string>
- Get a prioritized array of locales to use when strings are missing from the primary language file.
- getRightToLeftLocales() : array<string|int, string>
- Get an array of locales that use right-to-left formatting.
- getUserLocale() : string
- Get the current active locale.
- isLocaleInitialized() : bool
- Is the locale already initialized?
- isRightToLeftLocale() : bool
- Identify whether a particular locale uses right-to-left layout.
- markLocaleInitialized() : void
- Mark a locale as initialized.
- parseDefaultLocale() : string
- Extract and validate default locale from configuration.
- parseFallbackLocales() : array<string|int, string>
- Parses the configured language fallbacks.
- parseRightToLeftLocales() : array<string|int, string>
- Parses the right-to-left language configuration.
Properties
$browserDetectLanguage
Should we use auto-detect language based on browser settings?
protected
bool
$browserDetectLanguage
$defaultLocale
Default locale (code)
protected
string
$defaultLocale
$enabledLocales
Associative (code => description) array of enabled locales.
protected
array<string|int, mixed>
$enabledLocales
$fallbackLocales
Prioritized array of locales to use when strings are missing from the primary language file.
protected
array<string|int, string>
$fallbackLocales
$initializedLocales
Array of locales that have been initialized.
protected
array<string|int, string>
$initializedLocales
= []
$rightToLeftLocales
Array of locales that use right-to-left formatting.
protected
array<string|int, string>
$rightToLeftLocales
Methods
__construct()
Constructor
public
__construct(Config $config) : mixed
Parameters
- $config : Config
-
Configuration object
Return values
mixed —browserLanguageDetectionEnabled()
Should we use auto-detect language based on browser settings?
public
browserLanguageDetectionEnabled() : bool
Return values
bool —getDefaultLocale()
Get default locale.
public
getDefaultLocale() : string
Return values
string —getEnabledLocales()
Get an associative (code => description) array of enabled locales.
public
getEnabledLocales() : array<string|int, mixed>
Return values
array<string|int, mixed> —getFallbackLocales()
Get a prioritized array of locales to use when strings are missing from the primary language file.
public
getFallbackLocales() : array<string|int, string>
Return values
array<string|int, string> —getRightToLeftLocales()
Get an array of locales that use right-to-left formatting.
public
getRightToLeftLocales() : array<string|int, string>
Return values
array<string|int, string> —getUserLocale()
Get the current active locale.
public
getUserLocale() : string
Return values
string —isLocaleInitialized()
Is the locale already initialized?
public
isLocaleInitialized(string $locale) : bool
Parameters
- $locale : string
-
Locale code
Return values
bool —isRightToLeftLocale()
Identify whether a particular locale uses right-to-left layout.
public
isRightToLeftLocale(string $locale) : bool
Parameters
- $locale : string
-
Locale to check
Return values
bool —markLocaleInitialized()
Mark a locale as initialized.
public
markLocaleInitialized(string $locale) : void
Parameters
- $locale : string
-
Locale code
Return values
void —parseDefaultLocale()
Extract and validate default locale from configuration.
protected
parseDefaultLocale(Config $config) : string
Parameters
- $config : Config
-
Configuration
Tags
Return values
string —parseFallbackLocales()
Parses the configured language fallbacks.
protected
parseFallbackLocales(Config $config) : array<string|int, string>
Parameters
- $config : Config
-
Configuration
Return values
array<string|int, string> —parseRightToLeftLocales()
Parses the right-to-left language configuration.
protected
parseRightToLeftLocales(Config $config) : array<string|int, string>
Parameters
- $config : Config
-
Configuration