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

Csmccarthy/intl html substitution #182

Merged
merged 2 commits into from
Oct 10, 2024
Merged

Conversation

csmccarthy
Copy link
Member

Related Issues

Changelog

Sending in variables with the message internalization function broke the CM UI messages we were trying to display, since format.js was attempting to parse the message as rich text (there is no HTML option as far as I could tell) and encountering a parsing error due to invalid tags. i.e. was invalid because format.js can only substitute in HTML, not parse through it.

This should solve the issue by preprocessing our messages and removing HTML opening/closing tags, instead substituting them with format.js variables that we then replace during the internationalization process with the actual tags. For example:
we preprocess Example text with a <a href="https://example.com">link</a> to Example text with a {var_to_substitute_1}link{var_to_substitute_2} and then back to the original upon calling formatMessage.

Copy link

vercel bot commented Oct 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
consent-manager-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 9, 2024 11:39pm

Copy link

height bot commented Oct 9, 2024

This pull request has been linked to and will mark 1 task as "Pending Deploy" when merged:

💡Tip: You can link multiple Height tasks to a pull request.

Copy link
Member

@michaelfarrell76 michaelfarrell76 left a comment

Choose a reason for hiding this comment

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

u r amazin <3

@csmccarthy csmccarthy merged commit 3b65f19 into main Oct 10, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants