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

Add support for HTML translations. Fixes #310 #311

Merged
merged 7 commits into from
Oct 12, 2023
Merged

Conversation

excid3
Copy link
Owner

@excid3 excid3 commented Oct 12, 2023

This allows you to use _html translations that will be automatically marked as HTML safe.

Fixes #310

@excid3 excid3 added the enhancement New feature or request label Oct 12, 2023
@excid3 excid3 self-assigned this Oct 12, 2023
@excid3
Copy link
Owner Author

excid3 commented Oct 12, 2023

@Spone I think this should do the trick?

Copy link
Contributor

@Spone Spone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@Spone
Copy link
Contributor

Spone commented Oct 12, 2023

Maybe you need to require active_support/html_safe_translation?

@excid3
Copy link
Owner Author

excid3 commented Oct 12, 2023

Hmm, looks like this module was added in Rails 7. 🙃

I'm not opposed to making Noticed v2 only support Rails 7+, but we will definitely need a major version to bump the minimum required Rails version.

Alternatively, we could rescue from the require and only call super if it exists... which means this feature would only work for Rails 7+, but still can run on Rails 5.2 to 6.1. Tests would have to also check the Rails version accordingly.

@Spone
Copy link
Contributor

Spone commented Oct 12, 2023

Alternatively, we could rescue from the require and only call super if it exists... which means this feature would only work for Rails 7+, but still can run on Rails 5.2 to 6.1.

Sounds good!

@excid3
Copy link
Owner Author

excid3 commented Oct 12, 2023

Ayyy, there we go. Finally.

@excid3 excid3 merged commit 8864bbc into master Oct 12, 2023
60 checks passed
@excid3 excid3 deleted the html-translations branch October 12, 2023 01:55
@excid3
Copy link
Owner Author

excid3 commented Oct 12, 2023

Well shoot. Rafael said it's a private module, so it's not intended to be used like this. I guess we should reimplement ourselves in the gem.

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 this pull request may close these issues.

Support html_safe translation
2 participants