boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Versão melhorada para a data em português

 
Post new topic   Reply to topic    boardom Forum Index -> Ajuda em português
View previous topic :: View next topic  
Author Message
Fabio Assis



Joined: 18 May 2002
Posts: 7
Location: Belo Horizonte

PostPosted: Thu Jun 13, 2002 5:30 pm    Post subject: Versão melhorada para a data em português Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
macfisch



Joined: 30 Apr 2002
Posts: 46
Location: Salvador (BA) - Brasil

PostPosted: Thu Jun 20, 2002 11:12 pm    Post subject: Reply with quote

Valeu, funcionou direitinho.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Ajuda em português All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group