Read my latest article: 8 things I look for in a Ruby on Rails app (posted Thu, 06 Jul 2017 16:59:00 GMT)

Localization with Rails and PostgreSQL, part 1

Posted by Wed, 30 Nov 2005 17:36:00 GMT

1 comment Latest by highstatesmanship@gmail.com Wed, 28 Jun 2006 03:43:44 GMT

One of the client projects that PLANET ARGON is working on requires that it work in about 20 different languages. Jeremy has been investigating different plugins for Rails to help us accomplish this. He came across Globalize.

Globalize is a Ruby on Rails plugin designed to support multilingual applications. It’s under the MIT License, same as Ruby on Rails.

Locale.set( 'en-US' )
d = Diet.find( 1 ) 
d.name -> "Vegetarian"

... we want to pull back the German version. No, it doesn’t translate it for you.. just pulls back another version of the object with the desired locale.

Locale.set( 'de-DE' )
d = Diet.find( 1 ) 
d.name -> "Vegetarier"

Pretty cool, right?

Well, we’re primarily working with PostgreSQL and the Globalize plugin didn’t pass tests with it. That’s now fixed as I found out from Jeremy that he was given COMMIT rights to the Globalize plugin and it now passes all tests against PostgreSQL!

We’ll keep you updated on how well it works as we dig deeper into using it. :-)

Get help with your Rails project

comments powered by Disqus
Comments
  1. Avatar
    highstatesmanship@gmail.com Wed, 28 Jun 2006 03:43:44 GMT

    Help me, Rails and PostgreSQL development