Skip to content
Browse files

first attempt to extend the I18n.t method

  • Loading branch information...
1 parent 88f9335 commit 79519f332e99a925603c8d247cc4edf722aaaf3f @gnagno committed
View
4 app/helpers/lost-i18n-translation/application_helper.rb
@@ -1,4 +1,8 @@
module LostI18nTranslation
module ApplicationHelper
+ def pippo(*args)
+ 'ciao ciao'
+ end
end
+ ApplicationHelper.send :include, LostI18nTranslation::ApplicationHelper
end
View
2 lib/lost-i18n-translation.rb
@@ -1,4 +1,6 @@
require "lost-i18n-translation/engine"
+require "lost-i18n-translation/i18n_ext"
+
module LostI18nTranslation
end
View
7 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.
Something went wrong with that request. Please try again.