コード例 #1
0
 /**
  * @param $locale_head
  * @return string
  */
 static function setLocale($language, $region, $encoding)
 {
     if (self::$language != $language) {
         foreach (self::$domains as $domain) {
             self::resetDomain($domain);
         }
     }
     self::$language = $language;
     self::$region = $region;
     self::$encoding = $encoding;
     $locale = self::makeLocale($language, $region, $encoding);
     setlocale(LC_ALL, $locale);
     // set init encoding
     mb_language($language);
     mb_internal_encoding($encoding);
     mb_http_input($encoding);
     mb_http_output($encoding);
     return $locale;
 }