Merge pull request #15353 from overleaf/ae-upgrade-react-i18next

Upgrade react-i18next to 13.3.1

GitOrigin-RevId: fb2233742a187f1bf39e83f4e9f7ec3fb2a55b8f
This commit is contained in:
Alf Eaton 2023-10-20 11:16:32 +01:00 committed by Copybot
parent 113f5205c6
commit 10348b4544
3 changed files with 36 additions and 9 deletions

16
package-lock.json generated
View file

@ -31540,9 +31540,9 @@
} }
}, },
"node_modules/react-i18next": { "node_modules/react-i18next": {
"version": "13.3.0", "version": "13.3.1",
"resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-13.3.0.tgz", "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-13.3.1.tgz",
"integrity": "sha512-FlR9xjYHSPIJfQspEmkN0yOlxgRyNuiJKJ8gCaZH08UJ7SZHG+VrptEPcpEMEchjNoCOZdKcvJ3PnmHEZhkeXg==", "integrity": "sha512-JAtYREK879JXaN9GdzfBI4yJeo/XyLeXWUsRABvYXiFUakhZJ40l+kaTo+i+A/3cKIED41kS/HAbZ5BzFtq/Og==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/runtime": "^7.22.5", "@babel/runtime": "^7.22.5",
@ -39536,7 +39536,7 @@
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-error-boundary": "^2.3.1", "react-error-boundary": "^2.3.1",
"react-google-recaptcha": "^3.1.0", "react-google-recaptcha": "^3.1.0",
"react-i18next": "^13.3.0", "react-i18next": "^13.3.1",
"react-linkify": "^1.0.0-alpha", "react-linkify": "^1.0.0-alpha",
"react-refresh": "^0.14.0", "react-refresh": "^0.14.0",
"react-resizable-panels": "^0.0.55", "react-resizable-panels": "^0.0.55",
@ -47762,7 +47762,7 @@
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-error-boundary": "^2.3.1", "react-error-boundary": "^2.3.1",
"react-google-recaptcha": "^3.1.0", "react-google-recaptcha": "^3.1.0",
"react-i18next": "^13.3.0", "react-i18next": "^13.3.1",
"react-linkify": "^1.0.0-alpha", "react-linkify": "^1.0.0-alpha",
"react-refresh": "^0.14.0", "react-refresh": "^0.14.0",
"react-resizable-panels": "^0.0.55", "react-resizable-panels": "^0.0.55",
@ -66856,9 +66856,9 @@
} }
}, },
"react-i18next": { "react-i18next": {
"version": "13.3.0", "version": "13.3.1",
"resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-13.3.0.tgz", "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-13.3.1.tgz",
"integrity": "sha512-FlR9xjYHSPIJfQspEmkN0yOlxgRyNuiJKJ8gCaZH08UJ7SZHG+VrptEPcpEMEchjNoCOZdKcvJ3PnmHEZhkeXg==", "integrity": "sha512-JAtYREK879JXaN9GdzfBI4yJeo/XyLeXWUsRABvYXiFUakhZJ40l+kaTo+i+A/3cKIED41kS/HAbZ5BzFtq/Og==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/runtime": "^7.22.5", "@babel/runtime": "^7.22.5",

View file

@ -317,7 +317,7 @@
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-error-boundary": "^2.3.1", "react-error-boundary": "^2.3.1",
"react-google-recaptcha": "^3.1.0", "react-google-recaptcha": "^3.1.0",
"react-i18next": "^13.3.0", "react-i18next": "^13.3.1",
"react-linkify": "^1.0.0-alpha", "react-linkify": "^1.0.0-alpha",
"react-refresh": "^0.14.0", "react-refresh": "^0.14.0",
"react-resizable-panels": "^0.0.55", "react-resizable-panels": "^0.0.55",

View file

@ -116,5 +116,32 @@ describe('i18n', function () {
.should('have.length', 1) .should('have.length', 1)
.should('have.text', "T&e's<code>t</code>ing") .should('have.text', "T&e's<code>t</code>ing")
}) })
it('does not convert markup in values to components', function () {
const Test = () => {
return (
<div data-testid="container">
<Trans
i18nKey="are_you_still_at"
components={[<b />]} // eslint-disable-line react/jsx-key
values={{
institutionName: "<i>T</i>&<b>e</b>'s<code>t</code>ing",
}}
shouldUnescape
tOptions={{ interpolation: { escapeValue: true } }}
/>
</div>
)
}
cy.mount(<Test />)
cy.findByTestId('container')
.should(
'have.text',
"Are you still at <i>T</i>&<b>e</b>'s<code>t</code>ing?"
)
.find('b')
.should('have.length', 1)
.should('have.text', "<i>T</i>&<b>e</b>'s<code>t</code>ing")
})
}) })
}) })