New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add blank_html translation so it's possible to use html tags now #43
Conversation
end | ||
|
||
def blank_value(options) | ||
options.delete(:if_blank) || translate_blank_html.html_safe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that we need to call html_safe
here. Could you test it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I've tested it without html_safe
and it was escaped. So I think we need it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm. Actually I think that we should use ActionView::Helpers::TranslationHelper.translate
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean like this?
diff --git a/lib/show_for/content.rb b/lib/show_for/content.rb
index 4819292..6c44604 100644
--- a/lib/show_for/content.rb
+++ b/lib/show_for/content.rb
@@ -44,7 +44,7 @@ module ShowFor
end
def translate_blank_html
- I18n.t(:'show_for.blank_html', :default => translate_blank_text)
+ template.t(:'show_for.blank_html', :default => translate_blank_text)
end
def translate_blank_text
@@ -52,7 +52,7 @@ module ShowFor
end
def blank_value(options)
- options.delete(:if_blank) || translate_blank_html.html_safe
+ options.delete(:if_blank) || translate_blank_html
end
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed.
add blank_html translation so it's possible to use html tags now
Thank you ❤️ |
Yay! 😆 |
closes #29