Back to Language class

Method getLocale

public array
getLocale
()
Get the language locale based on current language.
Returns
  • array The locale according to the language.
Since
  • 1.7.0
Class: Language
Project: Joomla

Method getLocale - Source code

/**
 * Get the language locale based on current language.
 *
 * @return  array  The locale according to the language.
 *
 * @since   1.7.0
 */
public function getLocale()
{
    if (!isset($this->locale)) {
        $locale = str_replace(' ', '', $this->metadata['locale'] ?? '');
        if ($locale) {
            $this->locale = explode(',', $locale);
        } else {
            $this->locale = false;
        }
    }
    return $this->locale;
}