Hello all. It''s ok to internationalize thing at app using rails, but how to deal with content from database ? What''s the best aproach ? I don''t wanna do things like: <% if english %> <%= obj.name_english%> <% else %> <%= obj.name_japanese%> <% end %> The best way is to do all at controller ? model ? How do you thing is the better approach ? Thanks -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Jul-01 21:09 UTC
Re: best way to internationalize content from database
Anderson Leite wrote:> Hello all. > > It''s ok to internationalize thing at app using rails, but how to deal > with content from database ? >I think that may not be a good approach. I think it''s better to keep translated strings in PO files -- that way, you can hand them off to translators. Take a look at fast_gettext for this. It''s nicer than Rails'' own I18N.> What''s the best aproach ? I don''t wanna do things like: > > <% if english %> > <%= obj.name_english%> > <% else %> > <%= obj.name_japanese%> > <% end %> > > > The best way is to do all at controller ? model ? > > How do you thing is the better approach ? > > Thanks-- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Anderson Leite
2010-Jul-01 21:48 UTC
Re: best way to internationalize content from database
Hello Marnen "keep translated strings in PO files " but think about a content management system that users put information about a new protuct in english and portuguese. It''s easy to use i18n for labels...but.....what about the product description ?? I can''t put product description into a PO file....it has to come from a database.. -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Jul-02 05:54 UTC
Re: best way to internationalize content from database
Anderson Leite wrote:> Hello Marnen > > "keep translated strings in PO files " > > but think about a content management system that users put information > about a new protuct in english and portuguese. > > It''s easy to use i18n for labels...but.....what about the product > description ?? > > > I can''t put product description into a PO file....it has to come from a > database..Quite true. At that point, it makes sense to have a table with product_id, language_id, and description fields. -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org Sent from my iPhone -- Posted via http://www.ruby-forum.com/. -- 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.
Have you considered this http://github.com/joshmh/globalize2 ? On Jul 1, 10:36 pm, Anderson Leite <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hello all. > > It''s ok to internationalize thing at app using rails, but how to deal > with content from database ? > > What''s the best aproach ? I don''t wanna do things like: > > <% if english %> > <%= obj.name_english%> > <% else %> > <%= obj.name_japanese%> > <% end %> > > The best way is to do all at controller ? model ? > > How do you thing is the better approach ? > > Thanks > -- > Posted viahttp://www.ruby-forum.com/.-- 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.