Home > I18n-t.tmbundle

I18n-t.tmbundle

I18n-t.tmbundle is a project mainly written in Ruby, it's free.

Query / Generate Rails / Padrino I18n Locale for TextMate

What

Query / Generate Rails I18n Locale for TextMate.

Works for erb, slim and haml.

Install

Make sure i18n gem is installed.

cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/luikore/I18n-t.tmbundle.git

Usage

The key is option + L (you can change)

Query existing message

Then we get

Add a key that translates into selected text

Then we get

and the new key inserted into en.yml in the right position

Select a key that translates into selected text

Assume t('hello.world.title') == t('global') == 'Title'

Then we get

Config Output

Add environment variable EN_YML_FILE for output path (relative to config/locales).

For example, EN\_YML_FILE=new-key.yml will direct the output of new generated key to config/locales/new-key.yml.

Ruby 1.9

TextMate support lib is broken in Ruby 1.9.

To replace it for 1.8 and 1.9 compatibilities:

cd /Applications/TextMate.app/Contents/SharedSupport/Support/
mv lib lib.bak
wget cloud.github.com/downloads/luikore/I18n-t.tmbundle/lib.tgz
tar -zxvf lib.tgz