33 $this->initializeElggLocale();
42 return array_keys($this->locale);
65 return isset($this->locale[$language]) ? $this->locale[
$language] : [];
76 return (array) setlocale($category, 0);
128 private function initializeElggLocale() {
281 if (is_array($this->config->language_to_locale_mapping)) {
282 $this->locale = array_merge($this->locale, $this->config->language_to_locale_mapping);
elgg_get_current_language()
Get the current system/user language or "en".
getLocaleForLanguage(string $language)
Returns the configured locale settings for a given language key.
setLocaleForLanguage(string $language, array $locale=[])
Set the locale settings for a language key.
setLocale(int $category, $locale)
Set the system locale to a new value, return the locale before the change.
setLocaleFromLanguageKey(int $category, string $language=null)
Set the locale from a language key.
getLanguageCodes()
Returns a list of supported laguage codes.
__construct(Config $config)
Create new service.
Provides locale related features.
getLocale(int $category)
Get the current locale.