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
fernandan



Joined: 20 Feb 2005
Posts: 1
Location: Canoas/RS, Brazil

PostPosted: Sun Feb 20, 2005 10:51 pm    Post subject: Reply with quote

Oiii..

Eu fiz a alteração, e agora eu nao consigo mais logar no b2...
se alguem souber pq isso acontece, me fala...


OK??
valeu...
Back to top
View user's profile Send private message Visit poster's website
FabioAssis



Joined: 18 May 2002
Posts: 1
Location: Belo Horizonte, Brasil

PostPosted: Mon Feb 21, 2005 1:45 pm    Post subject: Reply with quote

Cara, fiz isso há muito muito tempo. Nem uso mais o B2 (agora uso o Wordpress).

Desculpa se deu algum pau aí no seu login. Mas é muito estranho. Isso não afeta em nada senhas / logins.

Tem que ver também a versão que vc está usando. Pode ser uma incompatibilidade entre a solução que eu usei e a que vc está usando.
Back to top
View user's profile Send private message Visit poster's website
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