Scanner for missing translation keys in Rails application
I am wondering if there are any tools available to scan for missing translation keys in a Rails application. eg if I have in my code <%= t :Submit %> but my English translation file does not contain submit: submit, I would like to be able to run a t开发者_如何学Pythonool that tells me which keys are missing.
i18n-tasks does exactly this:
It scans calls such as I18n.t('some.key')
and provides reports on key usage, missing, and unused keys. It can also can pre-fill missing keys, including from Google Translate, and it can remove unused keys as well.
This seems to be exactly what you're looking for: http://mentalized.net/journal/2009/08/10/find_missing_translations_in_your_rails_application/
It looks like it's on Github, too: http://github.com/koppen/i18n_missing_keys
EDIT: I answered the wrong question. New answer:
If you have enough integration tests, I think, in theory, all the missing keys should fire their I18n::MissingTranslationData
exceptions. This might be helpful in making that process easier: http://dev.innovationfactory.nl/2009/05/04/rails-i18n-caveats-and-tips/#translations
Sorry that I couldn't be of more help.
精彩评论