Click to Globalize is ready for Rails 2.1!

I spent a lot of time to make this release the best of ever! I know that a lot of time has passed since the latest Rails major release, and I apologize for this. The official Globalize it seems dead, but the great work of Nate Clark (aka heythisisnate) has made it compatible with Rails 2.1. Thanks Nate! The Rails Edge now includes a basic support for i18n!

What’s Changed?

The first big change is about the configuration, past versions has cluttered a bit your ApplicationController, I know, but now Click uses a YAML file configuration file for locales.
locales: english: en-US italian: it-IT

optional#

default: :english

optional#

formatting: textile
As you can see, it’s more readable than put an Hash inside your main controller, and it also take the advantage to separate configuration from logic.

The second change regards the default language, you can use the above file to declare it, or use the Globalize syntax (Globalize::Locale.set_base_language('en-US')), but you have to choose a locale before the app starts. This because Click needs a secure fallback mechanism, if no active Locale was set, it’s always guarantees your application to work.

The third feature is about formatting: you can always choose between textile and markdown without editing ApplicationController, but using the same configuration file.

I removed the deprecated class method ApplicationController#globalize? in favor of the instance one. This means you can use it to turn on/off Click to Globalize, just returning a boolean value:
ApplicationController

This version also includes tiny fixes, refactoring and cleanup.

You may wish to learn a bit about Click to Globalize, so I encourage you to visit the official page.
I hope you enjoy your i18n on Rails!