Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sunny
Last active August 29, 2015 14:01
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 sunny/a398c5da1390fea2fbbf to your computer and use it in GitHub Desktop.
Save sunny/a398c5da1390fea2fbbf to your computer and use it in GitHub Desktop.
Rails helper to show translation keys on the page
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