---
title: How to Find Missing or Unused I18n Translations
teaser:
tags: web,rails,i18n
author: Jessie Young
published_on: 2014-09-12
---

While I18n is a great tool for quick copy changes, translation files can quickly
become large and multiply, leaving you with the feeling that there are missing
or unused translations hiding under your nose. Enter
[i18n-tasks](https://github.com/glebm/i18n-tasks), which provides - you guessed
it - I18n tasks. Among these tasks are:

```bash
% i18n-tasks unused
```

and

```bash
% i18n-tasks missing
```

Want the test suite to fail when there are missing or unused tasks? Add
`i18n-tasks` to your `Gemfile`:

```ruby
group :test do
  gem "i18n-tasks"
end
```

```bash
% bundle
```

And run the following:

```bash
% cp $(i18n-tasks gem-path)/templates/rspec/i18n_spec.rb spec/
```

You now have a test in your `spec` directory that will fail when there are
missing or unused I18n translations!

**Bonus:** Use [thoughtbot's I18n-tasks config file
template](https://github.com/thoughtbot/suspenders/blob/eaf7de1c18bb264b5894ef3c07801b4221267933/templates/config_i18n_tasks.yml)
to set up your `config/i18n-tasks.yml` file. This will ensure that I18n-tasks
doesn't return false positives or false negatives.

## What's next

If you found this useful, you might also enjoy:

* [Foolproof I18n Setup in Rails]
* [Better Tests Through Internationalization]
* [Pluralizing I18n Translations in Your Rails Application]

[Foolproof I18n Setup in Rails]:
https://thoughtbot.com/blog/foolproof-i18n-setup-in-rails
[Better Tests Through Internationalization]:
https://thoughtbot.com/blog/better-tests-through-internationalization
[Pluralizing I18n Translations in Your Rails Application]:
https://thoughtbot.com/blog/pluralizing-rails-i18n-translations
