Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix translation issue where an interpolation param contains a ReactEl… #93

Merged
merged 1 commit into from
May 13, 2023
Merged

Fix translation issue where an interpolation param contains a ReactEl… #93

merged 1 commit into from
May 13, 2023

Conversation

MarcelRosenberger
Copy link
Contributor

This pull request fixes an issue with the translation where a param that is a ReactElement is interpolated into a translation string containing HTML.

language.json
{ "sample": { "title": "This demonstrates the <br /> {{ issue }}" } }

component.tsx
translate('sample.title', { issue: <div>Will not be shown</div> })

result
This demonstrates the
[object Object]

If the translation string does not contain html (<br />) the interpolation of the div param works.

…ement that is merged into a translation string containing HTML.

Fix translation issue where an interpolation param contains a ReactElement that is merged into a translation string containing HTML.
@DanielFran DanielFran requested a review from qmonmert May 11, 2023 17:51
Copy link
Contributor

@qmonmert qmonmert left a comment

Choose a reason for hiding this comment

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

Seems good but I did not try

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants