Skip to content
A TextMate Bundle to help with internationalization in Rails
Pull request Compare This branch is 5 commits ahead of isparling:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Rails i18n Bundle

by Ryan Stout

extended by Isaac Sparling & Geoff Hichborn & Dariusz Gertych


I did fine another Rails bundle that had i18n helpers, but none of them worked how I wanted them to, so I started over.

To make things easy, everything is based on using a default locale (english by default, which can be changed in Support/lib/config.rb) It also assumes the location of the english file is config/locales/en.yml

Read more about rails i18n here:


This bundle requires httparty, ruby-hmac, ya2yaml and google_translate to use.

sudo gem install httparty ruby-hmac ya2yaml google_translate

It should work with ruby 1.8.7 or 1.9


To Install:

mkdir -p ~/Library/Application\ Support/TextMate/Bundles
cd ~/Library/Application\ Support/TextMate/Bundles
git clone git:// "Rails i18n.tmbundle"
osascript -e 'tell app "TextMate" to reload bundles'

Add to locale

Select a section of text and hit CMD+SHIFT+I, this will then ask you for the token that identifies this string.
By default the bundle will build create token according to the position of file. So inserted tokens will look like examples below:

t('') or t('')

Edit translation

Select a token key and hit CMD+SHIFT+E, this will try to find a text associated to the token. Will show a box with translated text, where you can easily edit translation.

Edit config

Select from bundle menu "Edit config" it will open config.yml where you can change defaults settings

Calculate Cost

The bundle has support for translation api. Clicking on the calculate cost will give you a ESTIMATE of how much it will cost to translate your default locale into another language at the various qualities of

Translate strings to language

Select from bundle menu "Translate strings to language" will ask you what locale you want to translate the default locale into. You will then be asked how you want to translate the locale. It will then loop through every string and translate the strings using the selected service. Strings with existing translations will not be translated.

If you use google translate, translations will come back immediately.

The first time you choose to use MyGengo, you will be asked for your api_key and private_key

If you use, you will be asked if you want translation jobs to be auto approved, if you choose no you will have to go onto and approve all strings. When translating with, a placeholder will be inserted, then you can go to the bundle menu and select "Pull in MyGengo Translations" at a later point to pull in any finished translations. You can do this as many times as is required.


Please notice me if you find any :)

PS. I did a huge code refactoring.

I didn't check MyGengo service because I'm not using it.


Any comments, suggestions, pull requests are welcome!

Something went wrong with that request. Please try again.