Enhanced Localization Plugin for Rails

For a project I had at work, I need to have a website in different languages. I assumed this was a common task nowadays, but I quickly found the limits of current solutions in Rails or at least I didn’t found one which matched my criteras for this project : lightweight, allows texts localizations and more importantly permits URLs localizations.

So I took one of the simpler plugins for localization tasks : Localization from Thomas Fuchs. Then I tweaked it a little bit to make it fits my needs and here comes the result : Localization Enhanced. It allows you to easily translate your texts using simple hashes loaded at startup, have as many languages as you want and have controllers/actions translations as well, all using the standards Rails methods (link_to, url_for, etc.). Additionally, I added a little refinement to ActionView::Helpers::AssetTagHelper#image_tag which allows you to use different images based on the current languages where you need it (images-based menu bar, …), by passing :loc => true as an option to image_tag. This one results in image tag generating an url prefixed by the current language (EN_en, FR_fr, etc.) unless the current language is the default one.

If you want to give it a try here’s the subversion repository url to get it :

http://projects.tron.name/svn/railsplugins/localization_enhanced/

or directly install it with :

./script plugin install http://projects.tron.name/svn/railsplugins/localization_enhanced/

License is the same as the original one : MIT Licence (at least I think it is this one as I didn’t find any mention of one in the source).

Sun, 09 Jul 2006 16:09 Posted in

  1. By Lanfeust21 10/07/2006 at 17h56


    it’s password protected for the moment.

    I also have made huge change to add date localization support, many rake task to export/import data in dictionaries, modified the parse pattern ot gather more data, to control default language and so on

  2. By Tron Jonathan 10/07/2006 at 18h04


    SVN urls were wrong, I corrected them.

Comment Enhanced Localization Plugin for Rails


RSS