Skip to content

Commit

Permalink
first attempt to extend the I18n.t method
Browse files Browse the repository at this point in the history
  • Loading branch information
gnagno committed Jul 16, 2011
1 parent 88f9335 commit 79519f3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/helpers/lost-i18n-translation/application_helper.rb
@@ -1,4 +1,8 @@
module LostI18nTranslation module LostI18nTranslation
module ApplicationHelper module ApplicationHelper
def pippo(*args)
'ciao ciao'
end
end end
ApplicationHelper.send :include, LostI18nTranslation::ApplicationHelper
end end
2 changes: 2 additions & 0 deletions lib/lost-i18n-translation.rb
@@ -1,4 +1,6 @@
require "lost-i18n-translation/engine" require "lost-i18n-translation/engine"


require "lost-i18n-translation/i18n_ext"

module LostI18nTranslation module LostI18nTranslation
end end
7 changes: 7 additions & 0 deletions lib/lost-i18n-translation/i18n_ext.rb
@@ -0,0 +1,7 @@
module ActionView::Helpers::TranslationHelper
alias :t_old :t

def t(*args)
"prova: #{t_old(args)}"
end
end

0 comments on commit 79519f3

Please sign in to comment.