Skip to content

Instantly share code, notes, and snippets.

@bdunagan
Created September 4, 2014 21:28
Show Gist options
  • Save bdunagan/f71cf079071dbfa4b0bc to your computer and use it in GitHub Desktop.
Save bdunagan/f71cf079071dbfa4b0bc to your computer and use it in GitHub Desktop.
# routes.rb
get '/missing_keys', :to => 'home#missing_keys'
# home_controller.rb
def missing_keys
finder = MissingKeys.new(I18n.backend)
@all_keys = finder.all_keys
@missing_keys = finder.find_missing_keys
@found_keys = @all_keys.collect { |key| key unless @missing_keys.keys.include?(key) }.compact
# Reset locale.
set_locale()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment