Skip to content

Instantly share code, notes, and snippets.

@nathanl
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanl/6db4d82666372323ab50 to your computer and use it in GitHub Desktop.
Save nathanl/6db4d82666372323ab50 to your computer and use it in GitHub Desktop.
Quick and dirty way to spot non-localized strings in a Rails app page
# config/initializers/stupid_t.rb
# Any text that doesn't appear as "localized" isn't localized
module ActionView::Helpers::TranslationHelper
def t(*args)
result = I18n.t!(*args)
if result.respond_to?(:map)
result.map { |r| "localized" }
else
"localized"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment