/**
  * Uninstall a locale
  */
 function uninstallLocale()
 {
     parent::validate();
     $site =& Request::getSite();
     $locale = Request::getUserVar('locale');
     if (isset($locale) && !empty($locale) && $locale != $site->getPrimaryLocale()) {
         $installedLocales = $site->getInstalledLocales();
         if (in_array($locale, $installedLocales)) {
             $installedLocales = array_diff($installedLocales, array($locale));
             $site->setInstalledLocales($installedLocales);
             $supportedLocales = $site->getSupportedLocales();
             $supportedLocales = array_diff($supportedLocales, array($locale));
             $site->setSupportedLocales($supportedLocales);
             $siteDao =& DAORegistry::getDAO('SiteDAO');
             $siteDao->updateSite($site);
             AdminLanguagesHandler::removeLocalesFromJournals();
             Locale::uninstallLocale($locale);
         }
     }
     Request::redirect(null, null, 'languages');
 }