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 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
Copy link

Coverage Status

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

@redbugz
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
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?

@jamuhl
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
@jamuhl
Copy link
Member

jamuhl commented Aug 10, 2019

published in react-i18next@10.12.0

@jamuhl
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 defaults-icu branch August 10, 2019 09:40
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