Check out this StackOverflow question for some ideas. My preferred way is this answer on the same question.
Update . Nowadays, I use i18n-tasks to handle tests related to i18n, not what I wrote above or previously answered StackOverflow.
I wanted to use i18n in my RSpec tests, primarily to make sure that I have translations for everything, i.e. there were no missed translations. i18n tasks can do this and much more through static analysis of my code, so I no longer need to run tests for all I18n.available_locales
(in addition, when very locale-specific functions are tested, for example, switching from any locale to any other language in the system).
This meant that I can confirm that all i18n keys in the system really have values ββ(and that none of them are used or outdated), while keeping the number of repeated tests and, therefore, the set execution time down.
source share