kernel/classes/ezcontentlanguage.php
static function fetchByLocale( $locale, $createIfNotExist = false )
    {
        $languages = eZContentLanguage::fetchList();

        foreach ( $languages as $language )
        {
            if ( $language->attribute( 'locale' ) == $locale )
            {
                return $language;
            }
        }

        $language = false;
        if ( $createIfNotExist )
        {
            $language = eZContentLanguage::addLanguage( $locale );
        }

        return $language;
    }
static function fetchByLocale( $locale, $createIfNotExist = false )
    {
        $languages = eZContentLanguage::fetchList();

        foreach ( $languages as $language )
        {
            if ( $language->attribute( 'locale' ) == $locale )
            {
                return $language;
            }
        }

        $language = false;
        if ( $createIfNotExist )
        {
            $language = eZContentLanguage::addLanguage( $locale );
        }

        return $language;
    }
static function fetchByLocale ( $ locale , $ createIfNotExist = false ) { $ languages = eZContentLanguage :: fetchList ( ) ; foreach ( $ languages as $ language ) { if ( $ language -> attribute ( 'locale' ) == $ locale ) { return $ language ; } } $ language = false ; if ( $ createIfNotExist ) { $ language = eZContentLanguage :: addLanguage ( $ locale ) ; } return $ language ; }
Fetches the language identified by locale code.

\param locale Locale of the language to fetch, e. g. 'slk-SK'.
\return eZContentLanguage object identified by locale code $locale.
Fetches the language identified by locale code .