Posts for: #Click to Globalize

Click To Globalize for Rails 2.3

For all of you who don’t know what I’m talking about, **Click to Globalize** is a Rails plugin for in-place translations. Now it’s compatible with Rails 2.3 and It’s also the most clean and polish version of ever, let me explain what’s changed.

Engine

Yes, **Click to Globalize** is now an [engine](http://rails-engines.org/), this means all the controllers, the helpers, the routes and the other stuff, now lives in `vendor/plugins`. No more clutter with flying files, except for one javascript and one stylesheet.

I18n

The [i18n team](http://i18n-rails.org/) (myself included) worked hard to build a **consistent API** for i18n. Starting from Rails 2.2 we have bundled a gem for this purpose, and now my plugin is totally compliant with this system, this **agnosticism** allow you to use whatever i18n backend you want. Click to Globalize is **no longer a Globalize extension!!**

RESTful

The plugin now bundles two **full RESTful** controllers: `TranslationsController` and `LocalesController`, respectively `/translations` and `/locales`.

Lightweight

I replaced the annoying `around_filter` system, with a more lightweight one, based on the observation of `ActionView#render`.

Formatting

I removed the support for **Markdown** and **Textile**, personally I never used so much, and don’t think they are so related with i18n.

Deprecations

The old `globalize?` method is deprecated in favor of `in_place_translations?`.

You can find all the new instructions to the [project page](http://lucaguidi.com/projects/click-to-globalize) or on [GitHub](http://github.com/jodosha/click-to-globalize).
Enjoy!

[]

Click To Globalize: Ready for Rails 2.1!

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!

[]

Click to Globalize: rewritten and moved to GitHub

Click to Globalize has been rewritten, in order to use all instance methods of the JavaScript class, instead of class methods.

I also fixed some tiny issues:

  • The form_authentication_token method is called only if the application is protected against the CSRF attacks (protect_against_forgery? returns true)
  • It uses as parameter key what request_forgery_protection_token returns, instead of the hard-coded authenticity_token
  • The JavaScript class uses Prototype’s dom:loaded custom event.

I also migrated the plugin GitHub. The new repo is http://github.com/jodosha/click-to-globalize/tree/master, so the oldest one is deprecated. Have a nice globalization!

[]

Click To Globalize: Rails 2.0 Ready

I have finished to work on Click To Globalize, to made it Rails 2.0 compatible.

What’s Changed?

All and nothing: from the user point of view, the plugin has the same behaviors of the previous version. My recent activity was a refactoring, now it:

  • Works with CSRF Killer
  • Works with Prototype 1.6.0.1 and Scriptaculous 1.8.0.1
  • Works with rewritten version of Scriptaculous Ajax.InPlaceEditor
  • Works with new Prototype events handling
  • Uses new Prototype’s Element#addMethods and Function#wrap to add methods and AOP
  • Uses Protoype Hash#get, instead of square brackets
  • Uses .html.erb as helper, instead of .rhtml
  • Has a more clean installation/disinstallation process
  • Has DRYed up tests
  • Hasn’t prototype.js into the packaging

How To Use It?

Rails 2.0
$ ./script/plugin install http://dev.23labs.net/svn/rails/plugins/click_to_globalize/trunk
Rails 1.2.x
$ ./script/plugin install http://dev.23labs.net/svn/rails/plugins/click_to_globalize/branches/for-1.2.x

For a detailed guide, howtos, snippets, video-tutorials and other infos, please visit the Click To Globalize page.

[]