SwatI18N/SwatI18NLocale.php
public static function setlocale($category, $locale)
    {
        $return = false;

        static $categories = array(
            'LC_COLLATE' => LC_COLLATE,
            'LC_CTYPE' => LC_CTYPE,
            'LC_MONETARY' => LC_MONETARY,
            'LC_NUMERIC' => LC_NUMERIC,
            'LC_TIME' => LC_TIME,
            'LC_MESSAGES' => LC_MESSAGES
        );

        $parts = explode(';', $locale);
        if ($category === LC_ALL && count($parts) > 1) {
            // Handle case when LC_ALL is undefined and we're passing a giant
            // string with all the separate lc-type values.
            foreach ($parts as $part) {
                $part_exp = explode('=', $part, 2);
                if (
                    count($part_exp) === 2 &&
                    array_key_exists($part_exp[0], $categories)
                ) {
                    $return = setlocale(
                        $categories[$part_exp[0]],
                        $part_exp[1]
                    );
                }
            }
        } else {
            $return = setlocale($category, $locale);
        }

        return $return;
    }
public static function setlocale($category, $locale)
    {
        $return = false;

        static $categories = array(
            'LC_COLLATE' => LC_COLLATE,
            'LC_CTYPE' => LC_CTYPE,
            'LC_MONETARY' => LC_MONETARY,
            'LC_NUMERIC' => LC_NUMERIC,
            'LC_TIME' => LC_TIME,
            'LC_MESSAGES' => LC_MESSAGES
        );

        $parts = explode(';', $locale);
        if ($category === LC_ALL && count($parts) > 1) {
            // Handle case when LC_ALL is undefined and we're passing a giant
            // string with all the separate lc-type values.
            foreach ($parts as $part) {
                $part_exp = explode('=', $part, 2);
                if (
                    count($part_exp) === 2 &&
                    array_key_exists($part_exp[0], $categories)
                ) {
                    $return = setlocale(
                        $categories[$part_exp[0]],
                        $part_exp[1]
                    );
                }
            }
        } else {
            $return = setlocale($category, $locale);
        }

        return $return;
    }
public static function setlocale ( $ category , $ locale ) { $ return = false ; static $ categories = array ( 'LC_COLLATE' => LC_COLLATE , 'LC_CTYPE' => LC_CTYPE , 'LC_MONETARY' => LC_MONETARY , 'LC_NUMERIC' => LC_NUMERIC , 'LC_TIME' => LC_TIME , 'LC_MESSAGES' => LC_MESSAGES ) ; $ parts = explode ( ';' , $ locale ) ; if ( $ category === LC_ALL && count ( $ parts ) > 1 ) { // Handle case when LC_ALL is undefined and we're passing a giant // string with all the separate lc-type values. foreach ( $ parts as $ part ) { $ part_exp = explode ( '=' , $ part , 2 ) ; if ( count ( $ part_exp ) === 2 && array_key_exists ( $ part_exp [ 0 ] , $ categories ) ) { $ return = setlocale ( $ categories [ $ part_exp [ 0 ] ] , $ part_exp [ 1 ] ) ; } } } else { $ return = setlocale ( $ category , $ locale ) ; } return $ return ; }
Sets the current locale

This is a wrapper for the system setlocale() function that provides
extra compatibility.

@param integer $category optional. The lc-type constant specifying the
category of functions affected by setting
the system locale.
@param array|string $locale the locale identifier. Use '0' to return
the current system locale. Multiple locale
identifiers may be specified in an array.
In this case, the first valid locale is
used.

@return string|boolean the new or current locale, or false if an invalid
<i>$locale</i> is specified.
Sets the current locale