Esempio n. 1
0
 function getLocales()
 {
     include_once ROOT . API_FOLDER . "helpers/countries.php";
     $arr = array();
     $o = getLocaleList();
     foreach ($o as $a => $b) {
         foreach ($b as $e => $r) {
             $arr[$r] = strtolower($a);
         }
     }
     return $arr;
 }
Esempio n. 2
0
 function getLocaleSelector($default = "", $viewSample = false)
 {
     $arr = getLocaleList();
     $s = "<option value=''>None</option>";
     foreach ($arr as $a => $b) {
         if ($viewSample) {
             $y = end($b);
         } else {
             $y = $b[0];
         }
         if ($default == $a) {
             $s .= "<option value='{$a}' selected>{$y}</option>";
         } else {
             $s .= "<option value='{$a}'>{$y}</option>";
         }
     }
     return $s;
 }
 public function test_getLocaleList()
 {
     $arr = getLocaleList();
     $this->assertTrue($arr['kw'][0] == "Cornish" && $arr['mk'][0] == "Macedonian");
 }