Select Default Language for Field List

@param null|string $isoCode Language ISO Code (i.e en_US | fr_FR)

@return $this
437260
public function setDefaultLanguage($isoCode)
    {
        //====================================================================//
        // Safety Checks ==> Verify Language ISO Code
        if (!is_string($isoCode) || (strlen($isoCode) < 2)) {
            Splash::log()->err("Default Language ISO Code is Invalid");

            return $this;
        }
        //====================================================================//
        // Store Default Language ISO Code
        $this->dfLanguage = $isoCode;

        return $this;
    }
1277464
protected function getCurrencyByCode(string $isoCode): CurrencyTransfer
    {
        if (!isset($this->currenciesHeap[$isoCode])) {
            try {
                $currencyTransfer = $this->currencyFacade->fromIsoCode($isoCode);

                $this->currenciesHeap[$isoCode] = $currencyTransfer;
            } catch (Throwable $throwable) {
                throw new EntityNotFoundException(sprintf('Currency not found: %s', $isoCode));
            }
        }

        return $this->currenciesHeap[$isoCode];
    }
347148
protected function setLocale($langCode)
    {
        $translator = $this->translator();
        $translator->setLocale($langCode);

        $available = $translator->locales();
        $fallbacks = $translator->getFallbackLocales();

        array_unshift($fallbacks, $langCode);
        $fallbacks = array_unique($fallbacks);

        $locales = [];
        foreach ($fallbacks as $code) {
            if (isset($available[$code])) {
                $locale = $available[$code];
                if (isset($locale['locales'])) {
                    $choices = (array)$locale['locales'];
                    array_push($locales, ...$choices);
                } elseif (isset($locale['locale'])) {
                    array_push($locales, $locale['locale']);
                }
            }
        }

        $locales = array_unique($locales);

        if ($locales) {
            setlocale(LC_ALL, $locales);
        }
    }
504877
public function getDefault()
    {
        $sDefault  = $this->oCi->config->item('languages_default');
        $oLanguage = $this->getByCode($sDefault);

        return !empty($oLanguage) ? $oLanguage : false;
    }
50420
public function listGlobalAliases($languageCode = null, $offset = 0, $limit = -1)
    {
        return $this->service->listGlobalAliases($languageCode, $offset, $limit);
    }
950486
private function createLanguage($code)
    {
        $nameMap = array(
            'tr' => 'Türkçe',
            'en' => 'English',
            'de' => 'Deutsch',
            'fr' => 'Français',
            'ru' => 'Русский язык',
        );

        $lang = new Lang();
        $lang->setCode($code);
        !empty($nameMap[$code]) ?
            $lang->setName($nameMap[$code]) :
            $lang->setName('Unknown Language');

        $this->em->persist($lang);

        return $lang;
    }
436429
function setCurrentLanguage( $languageCode )
    {
        $this->CurrentLanguage = $languageCode;
        if ( $this->hasContentObject() )
        {
            $this->ContentObject->setCurrentLanguage( $languageCode );
        }
        $this->Name = null;
    }
581262
public static function getRedirectedLanguageCode($redirectLanguageCode, $redirects = null)
    {
        if (!$redirects && isset(Yii::$app->params['languageRedirects'])) {
            $redirects = Yii::$app->params['languageRedirects'];
        }

        if (!is_array($redirects) || empty($redirects)) {
            return $redirectLanguageCode;
        }

        $codes = array_flip($redirects);
        return (isset($codes[$redirectLanguageCode])) ? $codes[$redirectLanguageCode] : $redirectLanguageCode;
    }
630483
public function getName($languageCode = null)
    {
        if ($languageCode === null) {
            $languageCode = $this->initialLanguageCode;
        }

        return $this->names[$languageCode];
    }
566323
function removeTranslation( $languageCode )
    {

        $versionNum = $this->attribute( 'version' );

        $contentObjectAttributes = $this->contentObjectAttributes( $languageCode );

        $db = eZDB::instance();
        $db->begin();
        foreach ( $contentObjectAttributes as $attribute )
        {
            $attribute->removeThis( $attribute->attribute( 'id' ), $versionNum );
        }
        $db->commit();

        $this->updateLanguageMask();
    }
526229
public function getLanguage($languageCode = null): ?string
    {
        $languageCode = $languageCode ? mb_strtoupper($languageCode) : null;

        return $this->get("languages.{$languageCode}") ?: (current($this->get('languages', [])) ?: null);
    }
788380
public static function getLanguageForCode($code)
    {
        $language = KlarnaLanguage::fromCode($code);

        if ($language === null) {
            throw new Klarna_UnknownLanguageException($code);
        }
        return $language;
    }
1007491
public function translateToAnyLanguageOf(array $languageCodes): self
    {
        foreach ($languageCodes as $languageCode) {
            if (!is_string($languageCode) || empty($languageCode)) {
                throw new InvalidArgumentException('$languageCodes', 'All language codes should be non-empty strings');
            }
        }

        $this->targetVersionProperties['allLanguageCodesList'] = $languageCodes;

        return $this;
    }
1083405
def set_current_language(self, language_code, initialize=False):
        
        self._current_language = normalize_language_code(language_code or get_language())

        # Ensure the translation is present for __get__ queries.
        if initialize:
            self._get_translated_model(use_fallback=False, auto_create=True)
798112
public function encoding($encoding = null)
    {
        if (!func_num_args()) {
            return $this->_encoding;
        }
        $this->_encoding = $encoding ? strtolower($encoding) : null;
        return $this;
    }
583676
public static function localeName($code, $in_code = null)
    {
        $code = str_replace('-', '_', $code);
        $in_code = str_replace('-', '_', $in_code ?: \Locale::getDefault());

        static $languages;
        if (!isset($languages[$in_code])) {
            $languages[$in_code] = [];
            $resource = \ResourceBundle::create($in_code, 'ICUDATA-lang')->get('Languages');
            foreach($resource as $name => $value) {
                $languages[$in_code][$name] = $value;
            }
        }

        return isset($languages[$in_code][$code])
            ? $languages[$in_code][$code]
            : \Locale::getDisplayName($code, $in_code);
    }
683728
public static function setLanguageForSession($languageCode)
    {
        if (!API::getInstance()->isLanguageAvailable($languageCode)) {
            return false;
        }

        $cookieName = Config::getInstance()->General['language_cookie_name'];
        $cookie = new Cookie($cookieName, 0);
        $cookie->set('language', $languageCode);
        $cookie->setSecure(ProxyHttp::isHttps());
        $cookie->save();
        return true;
    }