Last active
August 29, 2015 14:22
-
-
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
This file contains hidden or 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
# 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