Fabio Assis
Joined: 18 May 2002 Posts: 7 Location: Belo Horizonte
|
Posted: Thu Jun 13, 2002 5:30 pm Post subject: Versão melhorada para a data em português |
|
|
Eu achei uma mensagem do Edney (www.interney.com.br) no PHPBR (http://br.groups.yahoo.com/group/phpbr), um bom lugar para olhar também em caso de dúvidas. A solução dele é bem completa. É o que está abaixo:
Quote: | Eu traduzi no b2config:
# the weekdays and the months.. translate them if necessary
$weekday[0]="domingo";
$weekday[1]="segunda-feira";
$weekday[2]="terça-feira";
$weekday[3]="quarta-feira";
$weekday[4]="quinta-feira";
$weekday[5]="sexta-feira";
$weekday[6]="sábado";
$month["01"]="janeiro";
$month["02"]="fevereiro";
$month["03"]="março";
$month["04"]="abril";
$month["05"]="maio";
$month["06"]="junho";
$month["07"]="julho";
$month["08"]="agosto";
$month["09"]="setembro";
$month["10"]="outubro";
$month["11"]="novembro";
$month["12"]="dezembro";
E apesar disso ainda precisei alterara a função mysql2date no
b2functions.php:
function mysql2date($dateformatstring, $mysqlstring) {
$m = $mysqlstring;
$i =
mktime(substr($m,11,2),substr($m,14,2),substr($m,17,2),substr($m,5,2),substr
($m,8,2),substr($m,0,4));
$i = date($dateformatstring, $i);
$i = str_replace('January','janeiro',$i);
$i = str_replace('February','fevereiro',$i);
$i = str_replace('March','março',$i);
$i = str_replace('April','abril',$i);
$i = str_replace('May','maio',$i);
$i = str_replace('June','junho',$i);
$i = str_replace('July','julho',$i);
$i = str_replace('August','agosto',$i);
$i = str_replace('September','setembro',$i);
$i = str_replace('October','outubro',$i);
$i = str_replace('November','novembro',$i);
$i = str_replace('December','dezembro',$i);
$i = str_replace('Sunday','Domingo',$i);
$i = str_replace('Monday','Segunda-feira',$i);
$i = str_replace('Tuesday','Terça-feira',$i);
$i = str_replace('Wednesday','Quarta-feira',$i);
$i = str_replace('Thursday','Quinta-feira',$i);
$i = str_replace('Friday','Sexta-feira',$i);
$i = str_replace('Saturday','Sábado',$i);
return $i;
}
daí usei a função the_date no template:
the_date('l, d \\d\e F \\d\e Y','<div align="right"><span
class="date">','</span></div>');
Bem, essa é uma das formas...
|
É isso. |
|