Want to stay on top? Ruby Weekly is a once-weekly e-mail newsletter covering the latest Ruby and Rails news.
     Feed Icon

Gibberish: Simple Localization Plugin for Rails

By Hendy Irawan / May 17, 2007

Gibberish is a Rails plugin developed by Chris Wanstrath which provides a hassle-free text translation capability for your Rails applications. The first application to use it is the Beast forum system.

Most localization tools use either key-string or original-message based translation. Gibberish strikes the balance between these techniques. Consider:

<%= "See you!"[] %>

By default, the translation keys use lowercase and underscored version of the original message, but a key can be provided as a symbol within the [] construction. Translation files are made up of simple YAML. An example id.yml for the above message would be:

see_you: Sampai jumpa!

If you're wondering about parameters in a message (e.g. "Hello, {user}!"), Gibberish also has support for that. All this and more is covered in an Err blog post.

Other localization alternatives: Globalize, Localization plugin.

About Hendy Irawan

Ruby programmer from Indonesia. View all posts by Hendy Irawan →

Other Posts to Enjoy

Twitter Mentions