New rake task for the Tranlsate plugin: Google Translate

We just pushed the latest addition to the Translate plugin which adds a new rake task: “rake translate:google FROM=sv TO=en”. This will translate all keys in sv.yaml using Google Translate into english and store them in en.yaml.

This is a very convinient way of testing your application in a translated state, and look for strings that were left un-extracted. Actually, I would say 80% of our application’s strings were translated correctly by Google, so less translation work for us!

The only drawback by this solution is the interpolated strings in yaml (“{{variable}}”) that is handled quite dodgy by Google. Sometimes the returned value would be “variable (())”, sometimes “(()) variable” and sometimes even “((var iable))”, with a broken variable name. Therefore we skip those strings for now. If you have a better solution for this, feel free to fork our repository over at Github and submit a patch!

Have a look at the massive language support at: http://translate.google.com/

This rake task depends on the HTTParty gem by John Nunemaker. Thank you John for making HTTP requests sexy!

Posted by Richard Posted in Ruby on Rails Tagged , ,
blog comments powered by Disqus