If you are a Ruby on Rails developer, and you internationalize your web applications, my i18n-edit Ruby Gem will make your life much easier! Gone is the need to have two screens open and text-edit the internationalized text in a locale file. Gone is the need to know translation keys and to match up the internationalized text in your views to the text you are editing, and the text you are testing in your web browser.
How easy could it get? Try this: Install i18n-edit according to the directions on Github. Start your Rails application locally, using this command:
I18N_EDIT=1 rails s
Now, go to any page in your live, running Rails application, and click on any internationalized text. An editor cursor will appear, and you can edit the text directly from the browser. To edit HTML attributes like tooltips, rather than text, right-click on the HTML node to see a menu with all of that node’s internationalized attributes. Click on their text to edit them right in the menu. Right click on links and buttons that would respond to left-click, or if you want to see what the translation key is.
I can’t imagine how this could get much simpler. I used to hate dealing with locale files. Now, I hardly ever have to touch them directly.
The locale file is written when you change the focus in your browser or when you go to another page. So, there’s no need for an enter button. The locale file is written using the link-create-write-fsync-rename algorithm that knowledgeable systems programmers use to create files that are always valid, even across a system crash.
What’s not to like? If you have written comments in your locale files, they’ll disappear. The standard for YAML files actually says that you shouldn’t parse comments, so none of the available YAML software handles them.