# Como utilizar InternacionalizaÃ§Ã£o no Rails - criar aplicaÃ§Ãµes em portuguÃªs

**URL:** <https://www.ruby-forum.com/t/como-utilizar-internacionalizaa-a-o-no-rails-criar-aplicaa-a-es-em-portugua-s/195981>\
**Category:** Rails\
**Created:** [October 4, 2010, 7:48pm UTC](https://www.ruby-forum.com/t/como-utilizar-internacionalizaa-a-o-no-rails-criar-aplicaa-a-es-em-portugua-s/195981 "2010-10-04T19:48:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wilson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/96bed5/32.png) [@wilson](https://www.ruby-forum.com/u/wilson)\
**Post date:** [October 4, 2010, 7:48pm UTC](https://www.ruby-forum.com/t/como-utilizar-internacionalizaa-a-o-no-rails-criar-aplicaa-a-es-em-portugua-s/195981/1 "2010-10-04T19:48:39Z")

</div>

Depois de buscas exaustivas no google ainda não consegui utilizar o  
i18n para internacionalização de aplicações com o Rails 3. Parece que  
houve algumas mudanças em como utilizá-lo a partir do Rails 3.  
Gostaria de criar minhas aplicações em português, sem ter que ficar  
traduzindo as views na unha.  
Qual seria a maneira mais indicada de fazer isso?

---

<div class="post-metadata">

**Author:** ![wilson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/96bed5/32.png) [@wilson](https://www.ruby-forum.com/u/wilson)\
**Post date:** [October 4, 2010, 7:55pm UTC](https://www.ruby-forum.com/t/como-utilizar-internacionalizaa-a-o-no-rails-criar-aplicaa-a-es-em-portugua-s/195981/2 "2010-10-04T19:55:05Z")

</div>

Translating:

After exhaustive searches on google I still can not use the  
i18n internationalization of applications with Rails 3. It seems that  
there were some changes in how to use it from Rails 3.  
I would like to create my applications in Portuguese, without having  
to stay  
reflecting the views on the nail.  
What would be the better way to do this?

---

<div class="post-metadata">

**Author:** ![wilson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/96bed5/32.png) [@wilson](https://www.ruby-forum.com/u/wilson)\
**Post date:** [October 4, 2010, 11:49pm UTC](https://www.ruby-forum.com/t/como-utilizar-internacionalizaa-a-o-no-rails-criar-aplicaa-a-es-em-portugua-s/195981/3 "2010-10-04T23:49:13Z")

</div>

Actually there were just some minor changes, like the new  
interpolation syntax (was “Helo {{user}}” and now it is “Hello %  
{user}”).

What exactly is the problem you are finding in use I18n?

---

<div class="post-metadata">

**Author:** ![wilson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/96bed5/32.png) [@wilson](https://www.ruby-forum.com/u/wilson)\
**Post date:** [October 5, 2010, 2:36pm UTC](https://www.ruby-forum.com/t/como-utilizar-internacionalizaa-a-o-no-rails-criar-aplicaa-a-es-em-portugua-s/195981/4 "2010-10-05T14:36:27Z")

</div>

Inside the folder “locale” I save the file pt-BR.yml. So, I’ve  
configured the application.rb file with “config.i18n.default\_locale  
= :pt-BR” .  
When I’ve tried to start the server: rails server, I got this  
message:  
/application.rb:32: uninitialized constant  
DicEtim::Application::BR (NameError), etc…  
I don’t know why, after I remove the “-BR” part of the file name, I  
didn’t get the error message anymore.

This is an example of my file (pt.yml):

* * *

pt (before was pt-BR):

# formatos de data e hora

date:  
formats:  
default: “%d/%m/%Y”  
short: “%d de %B”  
long: “%d de %B de %Y”

```
day_names: [Domingo, Segunda, Terça, Quarta, Quinta, Sexta,

```

Sábado]  
abbr\_day\_names: [Dom, Seg, Ter, Qua, Qui, Sex, Sáb]  
month\_names: [~, Janeiro, Fevereiro, Março, Abril, Maio, Junho,  
Julho, Agosto, Setembro, Outubro, Novembro, Dezembro]  
abbr\_month\_names: [~, Jan, Fev, Mar, Abr, Mai, Jun, Jul, Ago, Set,  
Out, Nov, Dez]  
order: [:day, :month, :year]

## 

How could I translate a button with the text (“create termo”) for  
example to (“criar termo”), that is generated by the controller below:

* * *

def new  
@termo = Termo.new

```
respond_to do |format|
  format.html # new.html.erb
  format.xml { render :xml => @termo }
end

```

## end

and \_format.html.erb :

* * *

\<%= form\_for(@termo) do |f| %\>  
\<% if @termo.errors.any? %\>

  

## \<%= pluralize(@termo.errors.count, “error”) %\> prohibited this termo from being saved:

```
  <ul>
  <% @termo.errors.full_messages.each do |msg| %>
    <li><%= msg %></li>
  <% end %>
  </ul>
</div>

```

\<% end %\>

 \<%= f.label :termo %\>  
 \<%= f.text\_field :termo %\> 

 \<%= f.label :significado %\>  
 \<%= f.text\_area :significado %\> 

 \<%= f.submit %\> 
\<% end %\>
* * *
