Maintain translations in Google Docs and export them to your Rails project.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 126 commits behind renuo:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


i18n-docs is a ruby gem that helps you to keep translations stored in Google Docs. This makes it easier for translators and project members to coordinate changes and updates. In addition, the standard features of Google Docs are super handy for this process: revision tracking, authorization, publishing, etc.

Although we use it with Google Docs, it could be used with any CSV file.

this gem is currently in use and tested with Rails 3.1. It probably works with other 3.x versions, but probably not 2.x at the moment.


  • download translations from multiple Google spreadsheets and store to YAML files
  • import/export YAML files with a Google Spreadsheet
  • check YAML files for missing translations (rake i18n:find_missing_keys)



Add the GEM to your Rails project:

gem 'i18n-docs'

Create a configuration file in config/translations.yml:

  navigation.yml: ""
  forms.yml: ""
  ... etc ...

Make the directories and files to hold the translations (this is a bit annoying, and will be automated soon):

$ for lang in de en it fr; do \
    mkdir -p config/locales/$lang; \
    touch config/locales/$lang/navigation.yml; \
    touch config/locales/$lang/forms.yml; \

Finally, let Rails know what locales you will be using. Add this to config/application.rb:

# locals to support:
I18n.available_locales = [:en,:de,:it,:fr]

This defines which languages and translation files to import from a Google Spreadsheet. The content of the Spreadsheet URL is stored to a file called e.g. example1.yml within folders config/locales/en and all other detected locales.

Rake Tasks

Following Rake tasks are added by the GEM to your Rails project:

  • rake i18n:export_translations Export all language files to CSV files (only files contained in 'en' folder are considered)
  • rake i18n:import_translations Download translations from Google Spreadsheet and save them to YAML files.
  • rake i18n:missing_keys Find and list translation keys that do not exist in all locales

Setup at Google Docs

  • At Google Docs, create a new spreadsheet for your translations. The first column is the translation key, the other columns are the languages: screenshot
  • use option File -> Publish To the Web screenshot
  • use get a link to generate a unique url that points to the CSV spreadsheet screenshot
  • From now on you should only update translations in Google Docs and run rake i18n:import_translations in the application to get changes. You can also export your


Pull requests welcome!

  • create mocked tests that do not have to download our sample CSV files
  • automate the creation of files in config/locales
  • automate the detection of which languages are supported
  • validate use with rails 2.x, other 3.x versions



Update docs, license. Push to


  • Open sourced: changed name and description.


  • removed loading of awesome_print from the rake task. It was breaking download


This gem is sponsored by It is licensed under the MIT license. If you're a ruby developer and want to work with us in Switzerland, please check out our jobs page.