Skip to content

Commit 3ae8046

Browse files
committed
🐛(frontend) fix fallback translations with Trans
The fallback of the Trans component didn't work anymore after upgrade to 16.2.3 of react-i18next. Upgrading to 16.3.3 fixed the issue. We added a test to cover this case.
1 parent a4e3168 commit 3ae8046

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to
2121
- 🐛(frontend) preserve @ character when esc is pressed after typing it #1512
2222
- 🐛(frontend) make summary button fixed to remain visible during scroll #1581
2323
- 🐛(frontend) fix pdf embed to use full width #1526
24+
- 🐛(frontend) fix fallback translations with Trans #1620
2425
- 🐛(pdf) fix table cell alignment issue in exported documents #1582
2526

2627
### Security

src/frontend/apps/e2e/__tests__/app-impress/home.spec.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,33 @@ test.describe('Home page', () => {
2727
// Check the titles
2828
const h2 = page.locator('h2');
2929
await expect(h2.getByText('Govs ❤️ Open Source.')).toBeVisible();
30+
await expect(page.getByText('Docs is built on top of')).toBeVisible();
31+
await expect(
32+
page.getByRole('link', {
33+
name: 'Django Rest Framework',
34+
}),
35+
).toHaveAttribute('href', 'https://www.django-rest-framework.org/');
36+
await expect(page.getByText('You can easily self-host Docs')).toBeVisible();
37+
await expect(
38+
page
39+
.getByRole('link', {
40+
name: 'licence',
41+
})
42+
.first(),
43+
).toHaveAttribute(
44+
'href',
45+
'https://github.com/suitenumerique/docs/blob/main/LICENSE',
46+
);
47+
await expect(
48+
page.getByText('Docs is the result of a joint effort lead by the French'),
49+
).toBeVisible();
50+
await expect(
51+
page
52+
.getByRole('link', {
53+
name: 'Zendis',
54+
})
55+
.first(),
56+
).toHaveAttribute('href', 'https://zendis.de/');
3057
await expect(
3158
h2.getByText('Collaborative writing, Simplified.'),
3259
).toBeVisible();

src/frontend/apps/impress/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"react": "*",
6363
"react-aria-components": "1.13.0",
6464
"react-dom": "*",
65-
"react-i18next": "16.2.3",
65+
"react-i18next": "16.3.3",
6666
"react-intersection-observer": "10.0.0",
6767
"react-resizable-panels": "3.0.6",
6868
"react-select": "5.10.2",

src/frontend/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12518,10 +12518,10 @@ react-dom@*, [email protected]:
1251812518
dependencies:
1251912519
scheduler "^0.27.0"
1252012520

12521-
react-i18next@16.2.3:
12522-
version "16.2.3"
12523-
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-16.2.3.tgz#079e3c54c85334ce9ab9732be3553516a7b7b42d"
12524-
integrity sha512-O0t2zvmIz7nHWKNfIL+O/NTIbpTaOPY0vZov779hegbep3IZ+xcqkeVPKWBSXwzdkiv77q8zmq9toKIUys1x3A==
12521+
react-i18next@16.3.3:
12522+
version "16.3.3"
12523+
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-16.3.3.tgz#098ff5443d0436a78692ca76303b2219aca32989"
12524+
integrity sha512-IaY2W+ueVd/fe7H6Wj2S4bTuLNChnajFUlZFfCTrTHWzGcOrUHlVzW55oXRSl+J51U8Onn6EvIhQ+Bar9FUcjw==
1252512525
dependencies:
1252612526
"@babel/runtime" "^7.27.6"
1252712527
html-parse-stringify "^3.0.1"

0 commit comments

Comments
 (0)