Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Find missing and extra translations in an application.

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 Rakefile
Octocat-spinner-32 i18n-extra_translations.gemspec


Find missing and extra translations in an application.


Add this line to your application's Gemfile:

gem 'i18n-extra_translations', require: false

And then execute:

$ bundle

Or install it yourself as:

$ gem install i18n-extra_translations


In development mode

The library includes a Rack-compatible class that allows you to see the missing keys.

In your config/routes.rb file or in your add something like this:

if Rails.env == 'development'
  require 'i18n/extra_translations'
  mount => '/i18n'

After this, check the path /i18n to see the missed keys.

At the end of your test suite

Add this code, or something close, to your (test|spec)_helper.rb :

require 'i18n/extra_translations'
at_exit do
  require 'awesome_print'
  puts 'Missing translations:'
  ap I18n::ExtraTranslations.missing_translations
  puts 'Unused translations:'
  ap I18n::ExtraTranslations.unused_translations


Set the reference locale

By default extra_translations focuses on the default locale only. It means that any other locale will not be used for both missing and unused translations. You can set the locale to use with the following code:

I18n::ExtraTranslations.locale = :fr

Unused translations for a specific file

By default the file used to find unused translations is "./config/locales/#{locale}.yml" where locale is the reference locale. You can pass a list of filepaths to look when you call I18n::ExtraTranslations.unused_translations:

locale_filepaths = ['./config/locales/en.yml', './config/locales/attributes.en.yml']


This gem is heavily inspired by Sven Fuchs's missing_translation gem.

Do not miss

There also i18n_tools that do the same kind of stuff that this gem with a different approach. While this gem hooks on I18n methods, the i18n_tools gem works by scanning your source code.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.