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

ICU: Trans macro will parse defaults as alternate to children #917

Merged
merged 1 commit into from Aug 10, 2019

Conversation

@redbugz
Copy link
Contributor

redbugz commented Aug 9, 2019

Fix for i18next/i18next#1295
Adds support for ICU message syntax inside the defaults attribute
This allows the Trans macro to be used with linters and other code analysis
tools that expect valid JSX syntax as children, by using the defaults
prop instead of children for the message.

Also adds support fo the <SelectOrdinal> tag
Fixes a bug where Trans was imported from 'react/i18next' instead of 'react-i18next'

Fix for i18next/i18next#1295
Adds support for ICU message syntax inside the `defaults` attribute
This allows the Trans macro to be used with linters and other code analysis
tools that expect valid JSX syntax as children, by using the defaults
prop instead of children for the message.

Also adds support fo the `<SelectOrdinal>` tag
Fixes a bug where `Trans` was imported from 'react/i18next' instead of 'react-i18next'
@coveralls

This comment has been minimized.

Copy link

coveralls commented Aug 9, 2019

Coverage Status

Coverage increased (+3.1%) to 95.128% when pulling f732d93 on redbugz:defaults-icu into edec7d0 on i18next:master.

@redbugz

This comment has been minimized.

Copy link
Contributor Author

redbugz commented Aug 9, 2019

I'm not sure if I am supposed to commit react-i18n.js and react-i18next.min.js or not.

@redbugz

This comment has been minimized.

Copy link
Contributor Author

redbugz commented Aug 9, 2019

Would you like me to split up the icu.macro.js file to get the line count under 250 to fix the codeclimate issue?

redbugz added a commit to redbugz/react-i18next-gitbook that referenced this pull request Aug 9, 2019
@jamuhl

This comment has been minimized.

Copy link
Member

jamuhl commented Aug 10, 2019

@redbugz no you can ignore the code climate for this one - I'm ok with that

I will merge this later today and publish an updated version...thank you for contributing

@jamuhl jamuhl merged commit c8223d6 into i18next:master Aug 10, 2019
3 of 4 checks passed
3 of 4 checks passed
codeclimate 1 issue to fix
Details
ci/circleci: build Your tests passed on CircleCI!
Details
coverage/coveralls Coverage increased (+3.1%) to 95.128%
Details
workflow Workflow: workflow
Details
@jamuhl

This comment has been minimized.

Copy link
Member

jamuhl commented Aug 10, 2019

published in react-i18next@10.12.0

@jamuhl

This comment has been minimized.

Copy link
Member

jamuhl commented Aug 10, 2019

If you like this module don’t forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project -> there are many ways to help this project 🙏

@redbugz redbugz deleted the redbugz:defaults-icu branch Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.