Andrey Subbotin

He is really passionate about programming and does believe that good software would one day make the world a better place to live. All the Apple hardware, the Human Interface Guidelines, and the Web 2.0 standards make him do his best.
Twitter Facebook Flickr YouTube Last.fm LinkedIn FriendFeed

rabelyoda: Rails Localization Made Easy

I have always been fond of small utilities that do one thing, probably one deadly simple thing, and by that save you from lots of boring routine on a day-by-day basis.

Say, you’ve got a Ruby on Rails project. Say, you keep a dozen files in your config/locales folder. Say, you periodically need to sync all of them to the original en.yml file and send to your translators for an update. It’s usually very boring and the chance of missing a string or another is high.

So, here comes a nifty gem to help you with that.

What it does is as follows:

  1. It reads all config/locales/*.yml
  2. It outputs them to config/locales.out/*.yml
  3. It adds all missing strings from en.yml to the other ymls.
  4. For each such string, “[pls translate]” is added at the beginning, so it’s easy to identify them in the resulting file.
  5. It removes all strings not present in en.yml from the other ymls. 

After that you grab the resulting files from config/locales.out and send them over to your translators. When the translation is made, you simply overwrite your original files in config/locales. That’s it. Nothing else.

Give it a try:

sudo gem install rabelyoda
cd your-rails-project-folder
rabelyoda 

Or browse the code at GitHub.

La-lal-la-la-la-la-la. :)