Skip to content
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

Support html_safe translation #310

Closed
Spone opened this issue Oct 9, 2023 · 5 comments · Fixed by #311
Closed

Support html_safe translation #310

Spone opened this issue Oct 9, 2023 · 5 comments · Fixed by #311
Labels
enhancement New feature or request

Comments

@Spone
Copy link
Contributor

Spone commented Oct 9, 2023

dcaf132 added a translate helper, but it doesn't support keys (such as message_html) being automatically marked as HTML-safe. I could be a nice addition to simplify adding links to the notification message, for instance.

Relevant: https://github.com/rails/rails/blob/main/activesupport/lib/active_support/html_safe_translation.rb

@excid3
Copy link
Owner

excid3 commented Oct 11, 2023

This would be a great addition. 👍

@excid3 excid3 added the enhancement New feature or request label Oct 11, 2023
@excid3
Copy link
Owner

excid3 commented Oct 12, 2023

Wonder if we could just include this module and use this without anything custom. 🤔

@Spone
Copy link
Contributor Author

Spone commented Oct 12, 2023

I tried quickly and it doesn't seem to work "as is".

@Spone
Copy link
Contributor Author

Spone commented Oct 12, 2023

But can't we include ActionView::Helpers::TranslationHelper somehow?

@excid3
Copy link
Owner

excid3 commented Oct 12, 2023

I don't think so since this is not in views.

Tried it too, but need to look into it a bit further.

excid3 added a commit that referenced this issue Oct 12, 2023
Allows users to use _html translations that will be automatically marked as html safe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants