small medium large xlarge

Img_0013_pragsmall
09 Feb 2010, 23:04
Xavier Décoret (7 posts)

Hi, thanks for the book, it is really good.

I am working the internationalization of my web app. Two questions:

  • first, the book gets out of the problem of localizing content in database with a little stunt (finally the customer does not need it). I would have expected a little bit more insights: should I manage myself a join table with translations (aka the summaries approach evoked), should I consider plugins like globalize, etc?

  • second, the solution described for switching the locale is to store it in the session. It works, and as a user, I tend to like it. But on “this page”:http://guides.rubyonrails.org/i18n.html they clearly state do not do so, and the argument makes sense. It is not RESTful since when I send an url to someone, she may not see the same thing than me. Could you provide us with an opinion?

Samr_small_pragsmall
10 Feb 2010, 14:27
Sam Ruby (634 posts)
  • first, the book sketches out the basic approaches (section 13.2 on page 201 of the paper version and 207 of the PDF), and unfortunately, this is not a case of one size fits all. Going fourth normal form has performance implications that may not be acceptable depending on your application. Yes, there are a number of plugins which will help reduce the coding and mitigate some of the performance issues, but I am not ready to recommend one over the others. I’ve provided a few links at the bottom of this post (as embedded links appear to be misbehaving in this wiki at the moment). Perhaps some of the people on the mailing list will be in a position to debate the relative merits of the various plugins?

  • second, yes, best practices has evolved since the book was written (edition 3 was based on 2.2 which was when I18n was first introduced into Rails). The next edition of the book will follow the current recommendations. To get it to work the way I liked, I had to advocate a number of changes to Rails, which are included in the Rails 3.0 beta, and I haven’t tested backporting those ideas to Rails 2.3.5; but you are welcome to review the code and ask questions (yet another link). Specifically look for set_i18n_locale_from_params and default_url_options. The part that I’m less clear will backport cleanly is optional scopes as a part of the route.

Links:

I18n wiki: http://rails-i18n.org/wiki I18n mailing list: http://groups.google.com/group/rails-i18n Edition 4 I18n code: http://intertwingly.net/projects/AWDwR4/checkdepot/section-15.1.html

Img_0013_pragsmall
10 Mar 2010, 00:11
Xavier Décoret (7 posts)

Thanks for the answer. I will review the code asap.

You must be logged in to comment