Mudando a Default Culture no Symfony 1.2, 1.3 e 1.4 [pt]

This post are available in english too. Click here

Este blog também esta disponível em português, clique aqui!

Uma pequena dica que pode salvar seu dia, como salvou de uma amigo.
Recebi uma pergunta de porque o symfony não estava alterando a culture, mesmo após inserir uma nova no arquivo settings.yml 

Normalmente ao trocar a culture padrão para pt_BR, o arquivo  vai ficar mais ou menos assim

all:
  .settings:
    default_culture: pt_BR

Então vocë atualiza a pagina, limpa o cache do symfony e nada parece mudar.

O problema ocorre porque o symfony guarda a informação da culture preferencial em um cookie, logo na primeira requisição. Logo, se não limpar os cookies( e cache) a nova configuração de culture não vai fazer efeito até os cookies vencerem

 

Filed under  //   culture   php   symfony  

Comments [0]

Default culture in symfony 1.2, 1.3 and 1.4 [EN]

Este blog também esta disponível em português, clique aqui!

A little tip, but that can save lifes!

This week I received a question about why symfony was not changing the culture after insert a new one in the settings.yml file.

usually, if you want the default culture to pt_BR,  the file will look like this:

all:
  .settings:
    default_culture: pt_BR

---

So, you refresh the browser and nothing seems to change.

The problem is that symfony store the default culture within a cookie in the very first request. So if you don`t clear you browse cookies, the new culture won't take effect until the cookie expires.  

 

 

Filed under  //   culture   php   symfony  

Comments [0]

About

A web developer

TwitterFacebookLinkedIn