public function setLanguage($language, $category = null)
    {
        if ($category === null) {
            $category = defined('LC_MESSAGES') ? LC_MESSAGES : LC_ALL;
        }

        setlocale($category, $language);
        putenv('LANGUAGE='.$language);

        return $this;
    }
public function setLanguage($language, $category = null)
    {
        if ($category === null) {
            $category = defined('LC_MESSAGES') ? LC_MESSAGES : LC_ALL;
        }

        setlocale($category, $language);
        putenv('LANGUAGE='.$language);

        return $this;
    }
public function setLanguage ( $ language , $ category = null ) { if ( $ category === null ) { $ category = defined ( 'LC_MESSAGES' ) ? LC_MESSAGES : LC_ALL ; } setlocale ( $ category , $ language ) ; putenv ( 'LANGUAGE=' . $ language ) ; return $ this ; }
Define the current locale.

@param string   $language
@param int|null $category

@return self
Define the current locale .