@param string $language

@return string
179676
public function getSlug($language = null)
    {
        $slugify = new Slugify();

        return $slugify->slugify($this->getTitle($language));
    }
45270
public function getTranslation($language = null)
    {
        if (!$language) {
            $language = $this->getLanguage();
        }
        if (!isset($this->_models[$language])) {
            $this->_models[$language] = $this->getNewTranslation($language);
        }
        return $this->_models[$language];
    }
334252
public function getLanguageCode($lang = null)
    {
        $parts = $this->_callInternalLocale('parseLocale', null, $lang, false);
        return isset($parts['language']) ? $parts['language'] : null;
    }
170700
private function getNewTranslation($language)
    {
        $translation = null;
        /** @var \yii\db\ActiveQuery $relation */
        $relation = $this->owner->getRelation($this->relation);
        /** @var ActiveRecord $class */
        $class = $relation->modelClass;
        //if ($translation === null) {
        $translation = new $class;
        $translation->{key($relation->link)} = $this->owner->getPrimaryKey();
        $translation->{$this->languageAttribute} = $language;
        //}
        return $translation;
    }
46575
public function getDefaultUrl($language = null)
    {
        foreach ($this->urls as $url) {
            if ($url->isDefault()) {
                return $url;
            }
        }

        return null;
    }
78103
public function getLangName( $lang = false ) {
		$lang = $lang ? $this->normalizeLang( $lang ) : $this->getLang();
		return $this->getLangNames()[$lang] ?? '';
	}
688145
public function languageCreate(\stdClass $language)
    {
        $this->dispatchHooks('BeforeLanguageCreateScope', $language);
        $language = $this->getDriver()->languageCreate($language);
        if ($language) {
            $this->dispatchHooks('AfterLanguageCreateScope', $language);
            $this->languages[$language->langcode] = $language;
        }
        return $language;
    }
1291150
public function filterLanguage($language = 'en')
    {
        return $this->filter(
            function ($key, $value) use ($language) {
                if ($value instanceof LanguageFilter && $value->getIso6391() == $language) {
                    return true;
                }
            }
        );
    }
674357
private function getPosixLocale(Language $language): ?array
    {
        if (!$language->enabled) {
            return null;
        }

        $posixLocale = $this->localeConverter->convertToPOSIX($language->languageCode);
        if ($posixLocale === null) {
            return null;
        }

        if (!Locales::exists($posixLocale)) {
            return null;
        }

        return [$posixLocale, Locales::getName($posixLocale)];
    }
147434
public function getLanguage($language)
    {
        if (!$this->getLanguages()->has($language)) {
            $this->getLanguages()->set($language, new LanguageBag());
        }

        return $this->getLanguages()->get($language);
    }
1283628
public static function get_smart_locale($language = null) {

		require_once FRAMEWORK_PATH . '/thirdparty/Zend/Locale.php';
		$locale = Zend_Locale::getBrowser();

		if(!$locale) {
			if($language) {
				return i18n::get_locale_from_lang($language);
			}
			else {
				return i18n::get_locale();
			}
		}

		$locale = array_keys($locale);
		$firstPref = array_shift($locale);

		if(strpos($firstPref, '_') === false) {
			return i18n::get_locale_from_lang($language);
		}

		return $firstPref;
	}
1271168
public function phoneme($string = '', $language = 'french')
        {
            $parts      = explode(' ', $string);
            $phonemes   = array();

            foreach ($parts as $p) {
                $p = $this->partCases(Inflector::lower($p));
                $phon = $this->$language($p);

                if ($phon != ' ' && strlen($phon)) {
                    array_push($phonemes, $phon);
                }
            }

            if($this->_sort) {
                sort($phonemes);
            }

            $string = implode(' ', $phonemes);

            return $string;
        }
1202064
public function removeLanguage($language)
    {
        $language = (string)$language;
        if (isset($this->entries[$language])) {
            unset($this->entries[$language]);
        }
        return $this;
    }
254129
private static function getMessagesByLanguage($language)
    {
        $messages = [];

        if (!array_key_exists($language, self::$messages)) {
            self::tryLoadingMessageFile($language);
        }

        if (array_key_exists($language, self::$messages)) {
            $messages = self::$messages[$language];
        } else {
            self::tryLoadingMessageFile('en');
            if (array_key_exists('en', self::$messages)) {
                $messages = self::$messages['en'];
            }
        }

        return $messages;
    }
224814
public function getByKeyWithTranslation($key, $language)
    {
        return EmailTemplate::find()
            ->byKey($key)
            ->withTranslation($language)
            ->one();
    }
377432
public static function getLocaliseClassPrefix($lang)
    {
        $lang = static::toLanguageTag($lang);

        $lang = str_replace('-', '', $lang);

        return ucfirst($lang);
    }
12984
public function getLocalBack($language)
    {
        $backUrl = redirect()->back()->getTargetUrl();
        $current = $this->getCurrentLanguage();
        $start = strpos($backUrl, $current);
        $count = strlen($current);
        if ($backUrl[$start - 1] == '/' && (!isset($backUrl[$start + $count])) || $backUrl[$start + $count] == '/') {
            $backUrl = substr_replace($backUrl, $language, $start, $count);
        }
        return $backUrl;
    }