Horde_Registry::_mapLang PHP Method

_mapLang() protected method

Maps languages with common two-letter codes (such as nl) to the full locale code (in this case, nl_NL). Returns the language unmodified if it isn't an alias.
protected _mapLang ( string $language ) : string
$language string The language code to map.
return string The mapped language code.
    protected function _mapLang($language)
    {
        // Translate the $language to get broader matches.
        // (eg. de-DE should match de_DE)
        $trans_lang = str_replace('-', '_', $language);
        $lang_parts = explode('_', $trans_lang);
        $trans_lang = Horde_String::lower($lang_parts[0]);
        if (isset($lang_parts[1])) {
            $trans_lang .= '_' . Horde_String::upper($lang_parts[1]);
        }
        return empty($this->nlsconfig->aliases[$trans_lang]) ? $trans_lang : $this->nlsconfig->aliases[$trans_lang];
    }