I’m tasked with localizing a huge Rails app, and it’s no fun, so I found some tools to help me and made a couple tools myself.
I now have a great script workflow that:
- https://github.com/balinterdi/i15r
- finds 80% of strings in .erb files and symbolizes them (do a dry run first, or git diff after, to see any issues)
- next, go through views and symbolize anything that you’ve missed, including :default values with ” quotes not ‘ apostrophes. Sublime plugin to assist here: https://gist.github.com/zyphlar/5219138
- https://gist.github.com/zyphlar/5216623
- extracts I18n symbols and their English translations to YML
- if you uncomment a certain line, it’ll also remove the english defaults from the .erb file.
This workflow should take ten minutes aside from the part where you go through and add what the script missed. The Sublime plugins are especially helpful for reducing tedious <%= %> syntax.