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

Omit object from t function #1858

Merged
merged 2 commits into from Oct 27, 2022
Merged

Conversation

pedrodurek
Copy link
Member

@pedrodurek pedrodurek commented Oct 25, 2022

Closes (probably): i18next/react-i18next#1559, i18next/next-i18next#1795

There is one downside about the approach proposed here. t function will no longer return object unless the option returnObjects is true. This is not applicable if t function is fully type-safe (https://www.i18next.com/overview/typescript), with the enhanced types, we can infer the exact return type.

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • run tests npm run test
  • tests are included
  • commit message and code follows the Developer's Certification of Origin

Checklist (for documentation change)

  • only relevant documentation part is changed (make a diff before you submit the PR)
  • motivation/reason is provided
  • commit message and code follows the Developer's Certification of Origin

@renomateo
Copy link

Thanks for working on this!

@adrai
Copy link
Member

adrai commented Oct 27, 2022

Can you remove the yarn.lock file?

@pedrodurek
Copy link
Member Author

Ohhh, sorry my mistake, we definitely can!

@adrai
Copy link
Member

adrai commented Oct 27, 2022

seems the tests are failing

@pedrodurek
Copy link
Member Author

I'm fixing them

@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.157% when pulling 3d7aaa0 on pedrodurek:string-t-return into 96613fa on i18next:master.

@adrai adrai merged commit c02b1ae into i18next:master Oct 27, 2022
@adrai
Copy link
Member

adrai commented Oct 27, 2022

included in v22.0.3

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.

None yet

4 participants