Last active
August 29, 2015 14:01
-
-
Save sunny/a398c5da1390fea2fbbf to your computer and use it in GitHub Desktop.
Rails helper to show translation keys on the page
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
module ApplicationHelper | |
# Add ?show_translation_keys=1 to URLs to let your team members | |
# know the name of the translation keys beeing used on the current | |
# page. | |
def t(key, options = {}) | |
if params[:show_translation_keys] | |
scope_key_by_partial(key) | |
else | |
super | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment