src/Attribute/Base.php
protected function getLangValue($arrValues, $strLangCode = null)
    {
        if (!($this->getMetaModel()->isTranslated() && is_array($arrValues))) {
            return $arrValues;
        }

        if ($strLangCode === null) {
            return $this->getLangValue($arrValues, $this->getMetaModel()->getActiveLanguage());
        }

        if (array_key_exists($strLangCode, $arrValues)) {
            return $arrValues[$strLangCode];
        }

        // Language code not set, use fallback.
        return $arrValues[$this->getMetaModel()->getFallbackLanguage()];
    }
protected function getLangValue($arrValues, $strLangCode = null)
    {
        if (!($this->getMetaModel()->isTranslated() && is_array($arrValues))) {
            return $arrValues;
        }

        if ($strLangCode === null) {
            return $this->getLangValue($arrValues, $this->getMetaModel()->getActiveLanguage());
        }

        if (array_key_exists($strLangCode, $arrValues)) {
            return $arrValues[$strLangCode];
        }

        // Language code not set, use fallback.
        return $arrValues[$this->getMetaModel()->getFallbackLanguage()];
    }
This extracts the value for the given language from the given language array.

If the language is not contained within the value array, the fallback language from the parenting
{@link IMetaModel} instance is tried as well.

@param array  $arrValues   The array holding all language values in the form array('langcode' => $varValue).

@param string $strLangCode The language code of the language to fetch. Optional, if not given,
$GLOBALS['TL_LANGUAGE'] is used.

@return mixed|null the value for the given language or the fallback language, NULL if neither is present.