/**
  * @param mixed $current_language_code Currently selected language
  * @param type $current_region_code Currently selected region
  */
 function __initialize($current_language_code = false, $current_region_code = false)
 {
     parent::__initialize();
     $this->script("Locale_Settings_Init();");
     $this->setData('role', 'region');
     $this->setData('controller', buildQuery($this->id));
     if ($current_language_code) {
         if ($current_language_code instanceof CultureInfo) {
             $lang = $current_language_code->ResolveToLanguage();
         } else {
             $lang = Localization::getLanguageCulture($current_language_code);
         }
         if (!$lang) {
             $lang = Localization::detectCulture()->ResolveToLanguage();
         }
         $regions = $lang->GetRegions(false);
         if (!$current_region_code) {
             $current_region_code = $lang->DefaultRegion()->Code;
         }
     } else {
         $regions = Localization::get_all_regions(false);
     }
     if ($current_region_code) {
         if ($current_region_code instanceof CultureInfo) {
             $this->SetCurrentValue($current_region_code->DefaultRegion()->Code);
         } else {
             $this->SetCurrentValue($current_region_code);
         }
     }
     if (count($regions) > 0) {
         $cc = current_controller(false);
         $translations_active = $cc instanceof Renderable && $cc->_translate;
         $sorted = array();
         foreach ($regions as $reg) {
             if (!$reg) {
                 continue;
             }
             $code = $reg->Code;
             if ($translations_active) {
                 $sorted[$code] = array("name" => tds("TXT_COUNTRY_" . strtoupper($code), $reg->EnglishName), "code", $code);
             } else {
                 $sorted[$code] = array("name" => $reg->EnglishName, "code", $code);
             }
         }
         uasort($sorted, __CLASS__ . "::compareCountryNames");
         foreach ($sorted as $code => $item) {
             $this->AddOption($code, $item['name']);
         }
     }
 }