Polyglot\Services\Lang::setInternalLocale PHP Метод

setInternalLocale() публичный Метод

Sets the locale according to the current language
public setInternalLocale ( string | boolean $locale = false ) : string
$locale string | boolean A language string to use
Результат string
    public function setInternalLocale($locale = false)
    {
        // If nothing was given, just use current language
        if (!$locale) {
            $locale = $this->getLocale();
        }
        // Base table of locales
        $this->locale = $locale;
        if (method_exists($this->app, 'setLocale')) {
            $this->app->setLocale($locale);
        }
        $locale = $this->shortToLongLocale($locale) . '.' . $this->getEncoding(true);
        // Set locale
        putenv('LC_ALL=' . $locale);
        setlocale(LC_ALL, $locale);
        // Specify the location of the translation tables
        bindtextdomain($this->domain, $this->getTranslationsFolder());
        textdomain($this->domain);
        return $this->getInternalLocale();
    }