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

feat: Trans interpolating self-closing tags in components prop(object) #1140

Merged
merged 2 commits into from
Jun 19, 2020

Conversation

abbudao
Copy link
Contributor

@abbudao abbudao commented Jun 18, 2020

This PR intends to close #1136. It provides:

  1. More versatility to the Trans component as now is possible to interpolate self-closing tags
  2. Updated Trans typing, reflecting the alternative usage described in docs.
  3. Improved readability on mapAst's reducer.

The third point is opinionated, but I was having trouble to reason with it the way it was written.
I was also forced to write the pushTranslatedJSX function (still unsure if this is the best name though) to keep the DRY principle.

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • run tests npm run test
  • tests are included
  • documentation is changed or added

@coveralls
Copy link

coveralls commented Jun 18, 2020

Coverage Status

Coverage increased (+0.08%) to 95.682% when pulling 3c9d55b on abbudao:trans-components-self-closing into d0d44a5 on i18next:master.

@jamuhl jamuhl merged commit 39ea4f0 into i18next:master Jun 19, 2020
@jamuhl
Copy link
Member

jamuhl commented Jun 19, 2020

thank you....was published in react-i18next@11.7.0

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.

Trans alternative usage with Self-Closing Tags
3 participants