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: add support for Translation render prop #691

Merged
merged 4 commits into from
Jan 16, 2023

Conversation

ggalletty
Copy link
Contributor

@ggalletty ggalletty commented Nov 14, 2022

Why am I submitting this PR

Currently the parser doesn't take into account <Translation> namespace for children expression within the render prop.

<Translation ns="foo">{(t) => t("some_key")}</Translation>

// js lexer result will miss namespace `foo`, assigning keys to the default one
{ key: "some_key" }

There's no documentation related to translation components so am not sure if there's any to add here as well.

Added test watch script to ease contributions. Figured I'd add that as well since it can benefit others. How I used it:

yarn test:watch test/lexers/jsx-lexer.test.js

Does it fix an existing ticket?

Yes #702

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • tests are included and pass: yarn test (see details here)
  • documentation is changed or added

@ggalletty ggalletty changed the title Parse namespace from Translation render prop feat: add support for Translation render prop Nov 21, 2022
@codecov-commenter
Copy link

Codecov Report

Base: 94.07% // Head: 94.08% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (7d1d441) compared to base (d6a956e).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #691      +/-   ##
==========================================
+ Coverage   94.07%   94.08%   +0.01%     
==========================================
  Files          11       11              
  Lines        1737     1742       +5     
==========================================
+ Hits         1634     1639       +5     
  Misses        103      103              
Impacted Files Coverage Δ
src/lexers/jsx-lexer.js 98.23% <100.00%> (+0.03%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@karellm karellm merged commit efec309 into i18next:master Jan 16, 2023
@karellm
Copy link
Member

karellm commented Jan 16, 2023

This is published as 7.3.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.

3 participants