public function applyLocale()
    {
        $strataLocale = $this->getCurrentLocale();
        $app = Strata::app();

        if (!is_null($strataLocale)) {
            $message =  setlocale(LC_ALL, $strataLocale->getCode() .'.UTF-8') ?
                "Localized to : " . $strataLocale->getCode() . ".UTF-8" :
                "Locale function is not available on this platform, or the given " .
                "local does not exist in this environment. Attempted to set: " .
                $strataLocale->getCode() . ".UTF-8";

            $app->setConfig("runtime.setlocale", $message);
        }

        // Set in PHP
        if (function_exists('bindtextdomain')) {
            $bound = bindtextdomain($this->getTextdomain(), Strata::getLocalePath());
            $app->setConfig("runtime.bindtextdomain", "PHP text domain was bound to <info>$bound</info>");
        }

        if (function_exists('textdomain')) {
            $bound = textdomain($this->getTextdomain());
            $app->setConfig("runtime.textdomain", "PHP message domain was bound to <info>$bound</info>");
        }

        // Set in WP
        global $locale;
        $locale = $strataLocale->getCode();

        return load_theme_textdomain($this->getTextdomain(), Strata::getLocalePath());
    }
public function applyLocale()
    {
        $strataLocale = $this->getCurrentLocale();
        $app = Strata::app();

        if (!is_null($strataLocale)) {
            $message =  setlocale(LC_ALL, $strataLocale->getCode() .'.UTF-8') ?
                "Localized to : " . $strataLocale->getCode() . ".UTF-8" :
                "Locale function is not available on this platform, or the given " .
                "local does not exist in this environment. Attempted to set: " .
                $strataLocale->getCode() . ".UTF-8";

            $app->setConfig("runtime.setlocale", $message);
        }

        // Set in PHP
        if (function_exists('bindtextdomain')) {
            $bound = bindtextdomain($this->getTextdomain(), Strata::getLocalePath());
            $app->setConfig("runtime.bindtextdomain", "PHP text domain was bound to <info>$bound</info>");
        }

        if (function_exists('textdomain')) {
            $bound = textdomain($this->getTextdomain());
            $app->setConfig("runtime.textdomain", "PHP message domain was bound to <info>$bound</info>");
        }

        // Set in WP
        global $locale;
        $locale = $strataLocale->getCode();

        return load_theme_textdomain($this->getTextdomain(), Strata::getLocalePath());
    }
public function applyLocale ( ) { $ strataLocale = $ this -> getCurrentLocale ( ) ; $ app = Strata :: app ( ) ; if ( ! is_null ( $ strataLocale ) ) { $ message = setlocale ( LC_ALL , $ strataLocale -> getCode ( ) . '.UTF-8' ) ? "Localized to : " . $ strataLocale -> getCode ( ) . ".UTF-8" : "Locale function is not available on this platform, or the given " . "local does not exist in this environment. Attempted to set: " . $ strataLocale -> getCode ( ) . ".UTF-8" ; $ app -> setConfig ( "runtime.setlocale" , $ message ) ; } // Set in PHP if ( function_exists ( 'bindtextdomain' ) ) { $ bound = bindtextdomain ( $ this -> getTextdomain ( ) , Strata :: getLocalePath ( ) ) ; $ app -> setConfig ( "runtime.bindtextdomain" , "PHP text domain was bound to <info>$bound</info>" ) ; } if ( function_exists ( 'textdomain' ) ) { $ bound = textdomain ( $ this -> getTextdomain ( ) ) ; $ app -> setConfig ( "runtime.textdomain" , "PHP message domain was bound to <info>$bound</info>" ) ; } // Set in WP global $ locale ; $ locale = $ strataLocale -> getCode ( ) ; return load_theme_textdomain ( $ this -> getTextdomain ( ) , Strata :: getLocalePath ( ) ) ; }
Assigns the theme's textdomain to Wordpress using 'load_theme_textdomain'.
@return boolean The result of load_theme_textdomain
@link https://codex.wordpress.org/Function_Reference/load_theme_textdomain
Assigns the theme s textdomain to Wordpress using load_theme_textdomain .