Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/07/2008, 21:34
Avatar de engranaje
engranaje
 
Fecha de Ingreso: febrero-2008
Mensajes: 45
Antigüedad: 16 años, 2 meses
Puntos: 1
Busqueda traducir estados del tiempo...

hola...
aver si me pueden ayudar...
como puedo crear una funcion para traducir los estados del tiempo en español????...
como ven en este link http://karku.net63.net/cli/weathernuevo.php los estados me salen en ingles..
gracias....

Código PHP:
<html>
<head>
</head>
<body>
<?
$timeout
=3*60*60;  // 3 hours
if (isset($_ENV["TEMP"]))
  
$cachedir=$_ENV["TEMP"];
else if (isset(
$_ENV["TMP"]))
  
$cachedir=$_ENV["TMP"];
else if (isset(
$_ENV["TMPDIR"]))
  
$cachedir=$_ENV["TMPDIR"];
else
// Default Cache Directory  
  
$cachedir="/tmp";
  
$cachedir=str_replace('\\\\','/',$cachedir);
if (
substr($cachedir,-1)!='/'$cachedir.='/';

$weather_chile = new weather("PAXX0005"3600"c"$cachedir);

// Parse the weather object via cached
// This checks if there's an valid cache object allready. if yes
// it takes the local object data, what's much FASTER!!! if it
// is expired, it refreshes automatically from rss online!
$weather_chile->parsecached(); // => RECOMMENDED!

// allway refreshes from rss online. NOT SO FAST. 
//$weather_chile->parse(); // => NOT recommended!


// ------------------- 
// OUTPUT
// -------------------

// ACTUAL SITUATION
print "<h1>Actual Situation</h1>";
//print_r($weather_chile->forecast['CURRENT']);
print "acttext: ".$weather_chile->forecast['CURRENT']['TEXT']."<br>";       // Partly Cloudy
print "acttemp: ".$weather_chile->forecast['CURRENT']['TEMP']."<br>";       // 16
//print "imagurl: ".$weather_chile->forecast['CURRENT']['IMAGEURL']."<br>"; // http://us.i1.yimg.com/us.yimg.com/i/us/nws/th/main_142b.gif
print "<img src=http://karku.net63.net/cli/ikonos/".$weather_chile->forecast['CURRENT']['CODE'].".png>";



// Forecast


for ($day=1; isset($weather_chile->forecast[$day]); $day++) {
  print 
"<h1>Forecast Day $day</h1>";
  
//print_r($weather_chile->forecast[$day]);
  
print "day: ".$weather_chile->forecast[$day]['DAY']."<br>";      // Wed
  
print "date: ".$weather_chile->forecast[$day]['DATE']."<br>";    // 26 Oct 2005
  
print "low °C: ".$weather_chile->forecast[$day]['LOW']."<br>";   // 8
  
print "high °C: ".$weather_chile->forecast[$day]['HIGH']."<br>"// 19
  
print "text: ".$weather_chile->forecast[$day]['TEXT']."<br>";    // Partly Cloudy
  
print "<img src=http://karku.net63.net/cli/ikonos/".$weather_chile->forecast[$day]['CODE'].".png>";

}

?>
</body>
</html>