``<t>`` doesn't work
Reported by Tomoaki Hayasaka | February 19th, 2011 @ 09:48 PM
1.3.0pre27
<t>
is broken by the commit 3c6267ab.
<t>
in a view calls rails' unmodified
ActionView::Helpers::TranslationHelper::translate
,
which is not hobo's one. It doesn't take care of :key, so it always
returns default fallback string.
Possible fix:
diff --git a/hobo/lib/hobo/engine.rb b/hobo/lib/hobo/engine.rb
index 9076a84..2f3f94d 100644
--- a/hobo/lib/hobo/engine.rb
+++ b/hobo/lib/hobo/engine.rb
@@ -37,7 +37,7 @@ module Hobo
ActiveSupport.on_load(:action_view) do
require 'hobo/extensions/action_view/tag_helper'
- include Hobo::Extensions::ActionView::TranslationHelper
+ require 'hobo/extensions/action_view/translation_helper'
end
ActiveSupport.on_load(:before_initialize) do
diff --git a/hobo/lib/hobo/extensions/action_view/translation_helper.rb b/hobo/lib/hobo/extensions/action_view/translation_helper.rb
index 59ee534..cae403c 100644
--- a/hobo/lib/hobo/extensions/action_view/translation_helper.rb
+++ b/hobo/lib/hobo/extensions/action_view/translation_helper.rb
@@ -1,6 +1,6 @@
-module Hobo::Extensions::ActionView::TranslationHelper
+ActionView::Base.send :include, Hobo::Helper::Translations::Normalizer
- include Hobo::Helper::Translations::Normalizer
+ActionView::Helpers::TranslationHelper.module_eval do
# simple wrapper around the translate helper
# it implements a dryml <translate> and a <t> tag
Comments and changes to this ticket
-
Domizio Demichelis March 10th, 2011 @ 08:03 PM
- State changed from new to resolved
aae682e5c71759757067efb1d5e18d836f657db7 should have fixed it
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »