Created
September 4, 2014 21:28
-
-
Save bdunagan/f71cf079071dbfa4b0bc to your computer and use it in GitHub Desktop.
Controller/Route for http://bdunagan.com/2014/09/01/rails-internationalization-at-scale/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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