wilson
2010-Oct-04 17:47 UTC
[Rails] Como utilizar Internacionalização no Rails - criar aplicações em português
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? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
wilson
2010-Oct-04 17:53 UTC
[Rails] Re: Como utilizar Internacionalização no Rails - criar aplicações em português
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? On 4 out, 14:47, wilson <wilson...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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?-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
reu
2010-Oct-04 21:48 UTC
[Rails] Re: Como utilizar Internacionalização no Rails - criar aplicações em português
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? On Oct 4, 2:53 pm, wilson <wilson...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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? > > On 4 out, 14:47, wilson <wilson...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > 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?-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
wilson
2010-Oct-05 12:34 UTC
[Rails] Re: Como utilizar Internacionalização no Rails - criar aplicações em português
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: <local of my application>/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] <continue> ------------------------------------ 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? %> <div id="error_explanation"> <h2><%= pluralize(@termo.errors.count, "error") %> prohibited this termo from being saved:</h2> <ul> <% @termo.errors.full_messages.each do |msg| %> <li><%= msg %></li> <% end %> </ul> </div> <% end %> <div class="field"> <%= f.label :termo %><br /> <%= f.text_field :termo %> </div> <div class="field"> <%= f.label :significado %><br /> <%= f.text_area :significado %> </div> <div class="actions"> <%= f.submit %> </div> <% end %> ------------------------------------ On 4 out, 18:48, reu <rnavar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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? > > On Oct 4, 2:53 pm, wilson <wilson...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > 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? > > > On 4 out, 14:47, wilson <wilson...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > 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?-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.