Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
ICU: Fixes macro to support count prop and expressions better #939
Fixes for #937
Also, if code is formatted with prettier, the extra whitespace was getting into the translations, so now trims the whitespace back to normal
If you had a values prop and a count, sometimes they didn't merge correctly. I believe that is fixed now.
The above also works for
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'
In the `useTranslation` hook, `useContext` is called conditionally, which breaks the Rule of Hooks, so it may cause problems in the future. This fixes it by calling `useContext` on every render, just not always using the result from it.
Fixes for #937 Allows count prop to use a variable also named count Add support for expressions in the count and switch props Handles the values prop better Allows macros to be self-closing without children Trims newlines and whitespace around code formatted with prettier or other formatting tools