Elgg
Version master
|
Provides locale related features. More...
Public Member Functions | |
__construct (protected Config $config) | |
Create new service. More... | |
getLanguageCodes () | |
Returns a list of supported laguage codes. More... | |
setLocaleForLanguage (string $language, array $locale=[]) | |
Set the locale settings for a language key. More... | |
getLocaleForLanguage (string $language) | |
Returns the configured locale settings for a given language key. More... | |
getLocale (int $category) | |
Get the current locale. More... | |
setLocale (int $category, $locale) | |
Set the system locale to a new value, return the locale before the change. More... | |
setLocaleFromLanguageKey (int $category, string $language=null) | |
Set the locale from a language key. More... | |
Protected Attributes | |
array | $locale |
Provides locale related features.
Definition at line 13 of file LocaleService.php.
Elgg\I18n\LocaleService::__construct | ( | protected Config | $config | ) |
Create new service.
Definition at line 22 of file LocaleService.php.
Elgg\I18n\LocaleService::getLanguageCodes | ( | ) |
Returns a list of supported laguage codes.
Mostly based on ISO-639-1
Definition at line 31 of file LocaleService.php.
Elgg\I18n\LocaleService::getLocale | ( | int | $category | ) |
Get the current locale.
int | $category | which locale setting should be returned |
Definition at line 65 of file LocaleService.php.
Elgg\I18n\LocaleService::getLocaleForLanguage | ( | string | $language | ) |
Returns the configured locale settings for a given language key.
string | $language | the language key (eg. 'en') |
Definition at line 54 of file LocaleService.php.
Elgg\I18n\LocaleService::setLocale | ( | int | $category, |
$locale | |||
) |
Set the system locale to a new value, return the locale before the change.
int | $category | which locale setting should be affected |
string | array | $locale | the new locale |
Definition at line 80 of file LocaleService.php.
Elgg\I18n\LocaleService::setLocaleForLanguage | ( | string | $language, |
array | $locale = [] |
||
) |
Set the locale settings for a language key.
string | $language | the language key (eg. 'en') |
array | $locale | the locale settings (eg. ['en_US']) |
Definition at line 43 of file LocaleService.php.
Elgg\I18n\LocaleService::setLocaleFromLanguageKey | ( | int | $category, |
string | $language = null |
||
) |
Set the locale from a language key.
The key will be mapped to the configured locale settings
int | $category | which locale settings should be affected |
string | $language | the language te set the locale for (default: current language) |
Definition at line 96 of file LocaleService.php.
|
protected |
Definition at line 15 of file LocaleService.php.