Пример #1
0
 function getDefaultLocale()
 {
     fbDebug::enter();
     $_locale_cache =& fbLocale::_locale_cache();
     if (isset($_locale_cache[LC_ALL]['C'])) {
         fbDebug::leave($_locale_cache[LC_ALL]['C']['locale']);
         return $_locale_cache[LC_ALL]['C']['locale'];
     }
     $_locale =& fbLocale::_locale();
     if (!$_locale[LC_ALL]) {
         fbLocale::_setLocale(LC_ALL, null);
         fbLocale::_setLocale(LC_COLLATE, null);
         fbLocale::_setLocale(LC_CTYPE, null);
         fbLocale::_setLocale(LC_MONETARY, null);
         fbLocale::_setLocale(LC_NUMERIC, null);
         fbLocale::_setLocale(LC_TIME, null);
     }
     fbDebug::dump($_locale, '$_locale');
     $locale = fbLocale::_getLocale(LC_ALL);
     fbDebug::dump($locale, '$locale');
     if ($locale && $locale != 'C') {
         $a = fbLocale::_parseLocale($locale);
     } else {
         $a = fbLocale::_guessLocale();
     }
     fbDebug::dump($a, '$a');
     $locale = $a['locale'];
     if ($locale == 'C') {
         $a = fbLocale::_guessLocale();
     }
     $_locale_cache[LC_ALL]['C'] = $a;
     $_locale_cache[LC_ALL][$locale] = $a;
     fbDebug::dump($_locale_cache, '$_locale_cache');
     fbDebug::dump($locale, '$locale');
     fbDebug::leave($locale);
     return $locale;
 }