Sourced from react-i18next's changelog.
17.1.8
- fix(Trans): an interpolation variable named
formatis no longer dropped.Transreadsformatin an interpolation object as the formatter name ({{ value, format }}), so with{{ format }}as the only key nothing was left:<Trans>Export as {{ format }}</Trans>warnedTRANS_INVALID_OBJand used the default stringExport asinstead ofExport as {{format}}. Whenformatis the object's only key it is now treated as the variable.{{ value, format }}works as before. Without ani18nKey, the key derived from the children changes accordingly, fromExport astoExport as {{format}}. i18next-cli serializesTranschildren with react-i18next, so extracting with this version produces the same key. Thanks@Pharex38(#1944).17.1.7
- fix(IcuTrans): each HTML entity in a translation is now decoded exactly once. Named, decimal and hexadecimal entities were decoded in three passes, and each pass decoded the output of the previous one, so an escaped numeric entity was decoded twice:
"Write &[#169](https://github.com/i18next/react-i18next/issues/169); to get &[#169](https://github.com/i18next/react-i18next/issues/169);"renderedWrite © to get ©instead ofWrite &[#169](https://github.com/i18next/react-i18next/issues/169); to get ©, and&[#60](https://github.com/i18next/react-i18next/issues/60);rendered<instead of&[#60](https://github.com/i18next/react-i18next/issues/60);. This also hit interpolated values withescapeValue: true, where a value containing&[#60](https://github.com/i18next/react-i18next/issues/60);is escaped to&[#60](https://github.com/i18next/react-i18next/issues/60);. Escaped named entities like&lt;already stayed<, as browsers andTransdecode them. Unknown named entities and entities above U+10FFFF still stay as written. Thanks@Pharex38(#1943).17.1.6
- fix(Trans): a
countpassed intOptionsis now used.TransspreadtOptionsand then set its owncountprop, so a count only intOptionswas overwritten withundefined:<Trans i18nKey="items" tOptions={{ count: 5 }} />rendered the keyitemsinstead of5 items, and with childrenTranscould pick the wrong plural form. Likecontext,Transnow falls back totOptions.count, handled the same way as thecountprop. Acountprop, a count in the children orvalues.countstill take precedence, andtOptionsis not modified. Thanks@nk-batman21(#1942).17.1.5
- fix(Trans): with an array of keys and no children,
Transnow falls back to the last key when none of them has a translation, ast()does. It used the array itself asdefaultValue, which i18next handles as an object, so<Trans i18nKey={['notifications.crm_item_created', 'crm_item_created']} components={[<strong />]} />renderedkey 'crm_item_created (en)' returned an object instead of string.instead ofcrm_item_created. An array of selectors falls back to the key of the last selector. The first key that has a translation still wins, andchildren,defaultsandtOptions.defaultValueare used as before. WithsaveMissing, these calls now report the missing key, like a singlei18nKeydoes. Thanks@nk-batman21(#1941).
3f0880e
17.1.89802f17
buildfb5fa17
changelog for 17.1.863f4e41
fix(Trans): don't drop an interpolation variable named format (#1944)8655c0f
17.1.75e2cf4a
build4745dc6
changelog for 17.1.7b708a76
fix(IcuTrans): decode each HTML entity only once (#1943)a8626e0
17.1.6c0cafdf
build