From 628a6ee4d11a0428eae8251201d0c5db32f1aff5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2026 11:44:21 +0000 Subject: [PATCH 1/2] chore(deps): bump react-i18next from 17.0.14 to 18.0.0 in /frontend Bumps [react-i18next](https://github.com/i18next/react-i18next) from 17.0.14 to 18.0.0. - [Changelog](https://github.com/i18next/react-i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/react-i18next/compare/v17.0.14...v18.0.0) --- updated-dependencies: - dependency-name: react-i18next dependency-version: 18.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- frontend/package-lock.json | 25 ++++++++++--------------- frontend/package.json | 2 +- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 0e3341b9..7012bc98 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -45,7 +45,7 @@ "motion": "^14.9.0", "react": "^19.2.5", "react-dom": "^19.3.0", - "react-i18next": "^17.0.14", + "react-i18next": "^18.0.0", "react-router-dom": "^7.18.4", "sql-formatter": "^15.8.2", "tailwind-merge": "^3.6.0", @@ -10449,27 +10449,22 @@ } }, "node_modules/react-i18next": { - "version": "17.0.14", - "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-17.0.14.tgz", - "integrity": "sha512-ZpMBfJL3BiXPuYHj5QMY1GwvKJNhE1vCxOJQ8BoMBdHP5XONTfi/Qss1nuRlnFdIl72PKo2jPmw+fxuLjRFgaQ==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-18.0.0.tgz", + "integrity": "sha512-xXq/pcuMRwrW4iH0If/RjbPH3zuEqWVtaw4PjDsG54vx0FTook7aS3kop7DXy3g66wHkYUji8l7ZBrA8kfj67Q==", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.29.7", - "html-parse-stringify": "^4.0.1", - "use-sync-external-store": "^1.6.0" + "html-parse-stringify": "^4.0.1" + }, + "engines": { + "node": ">=22" }, "peerDependencies": { - "i18next": ">= 26.2.0", - "react": ">= 16.8.0", + "i18next": ">= 27.0.0", + "react": ">= 18.0.0", "typescript": "^5 || ^6 || ^7" }, "peerDependenciesMeta": { - "react-dom": { - "optional": true - }, - "react-native": { - "optional": true - }, "typescript": { "optional": true } diff --git a/frontend/package.json b/frontend/package.json index 079eb0f4..5be747bc 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -51,7 +51,7 @@ "motion": "^14.9.0", "react": "^19.2.5", "react-dom": "^19.3.0", - "react-i18next": "^17.0.14", + "react-i18next": "^18.0.0", "react-router-dom": "^7.18.4", "sql-formatter": "^15.8.2", "tailwind-merge": "^3.6.0", From 17c767b0a4a9cc95ba223aa386e44d63e71ac1d8 Mon Sep 17 00:00:00 2001 From: Tigran Babloyan Date: Wed, 11 Nov 2026 17:43:23 +0400 Subject: [PATCH 2/2] fix(deps): bump i18next to 27 for react-i18next 18 react-i18next 18 requires i18next >= 27. Keep empty translations rendering as empty (returnEmptyString: true) and type t-wrappers as TFunction. --- frontend/package-lock.json | 11 +++++++---- frontend/package.json | 2 +- frontend/src/components/common/NotificationBell.tsx | 3 ++- frontend/src/i18n.d.ts | 1 + frontend/src/i18n.ts | 1 + .../src/pages/queries/buildTimelineStages.test.ts | 7 +++++-- frontend/src/pages/queries/buildTimelineStages.ts | 4 ++-- 7 files changed, 19 insertions(+), 10 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 95fac36e..f76c3b9b 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -41,7 +41,7 @@ "d3-shape": "^3.2.0", "dagre": "^0.8.5", "dayjs": "^1.11.23", - "i18next": "^26.4.0", + "i18next": "^27.1.1", "motion": "^14.9.0", "react": "^19.2.5", "react-dom": "^19.3.0", @@ -8658,9 +8658,9 @@ } }, "node_modules/i18next": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-26.4.0.tgz", - "integrity": "sha512-rsmK5bFqsD1AetSFSIa43wtNR4WpvvH4p0tLEsTxkC7QTrfdFm06nbQ95bh8Og4wwaCnUEcm9DVYL2cgxitiQg==", + "version": "27.1.1", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-27.1.1.tgz", + "integrity": "sha512-Qq3aJizS3RXQ30crhx9BKQLrHoa6GKpgrOJjVZ9vgj3EBxAddrmVfDNUrAMxSUimw5Jc+ld4SSZUAzf1q4nGyQ==", "funding": [ { "type": "individual", @@ -8676,6 +8676,9 @@ } ], "license": "MIT", + "engines": { + "node": ">=22" + }, "peerDependencies": { "typescript": "^5 || ^6 || ^7" }, diff --git a/frontend/package.json b/frontend/package.json index 250c2804..3762184c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -47,7 +47,7 @@ "d3-shape": "^3.2.0", "dagre": "^0.8.5", "dayjs": "^1.11.23", - "i18next": "^26.4.0", + "i18next": "^27.1.1", "motion": "^14.9.0", "react": "^19.2.5", "react-dom": "^19.3.0", diff --git a/frontend/src/components/common/NotificationBell.tsx b/frontend/src/components/common/NotificationBell.tsx index 61a2e775..b3bb0a05 100644 --- a/frontend/src/components/common/NotificationBell.tsx +++ b/frontend/src/components/common/NotificationBell.tsx @@ -1,3 +1,4 @@ +import type { TFunction } from 'i18next'; import { useState } from 'react'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useNavigate } from 'react-router-dom'; @@ -175,7 +176,7 @@ export function NotificationBell() { function renderMessage( item: UserNotification, - t: (key: string, options?: Record) => string, + t: TFunction, ): string { const payload: UserNotificationPayload = item.payload ?? {}; const datasource = payload.datasource ?? '—'; diff --git a/frontend/src/i18n.d.ts b/frontend/src/i18n.d.ts index c4e07ac0..e6573807 100644 --- a/frontend/src/i18n.d.ts +++ b/frontend/src/i18n.d.ts @@ -5,5 +5,6 @@ declare module 'i18next' { interface CustomTypeOptions { defaultNS: 'translation'; resources: { translation: typeof en }; + returnEmptyString: true; } } diff --git a/frontend/src/i18n.ts b/frontend/src/i18n.ts index a0e8b548..9e0f23cf 100644 --- a/frontend/src/i18n.ts +++ b/frontend/src/i18n.ts @@ -51,6 +51,7 @@ i18n.use(initReactI18next).init({ lng: persistedLanguage, fallbackLng: 'en', interpolation: { escapeValue: false }, + returnEmptyString: true, }); export default i18n; diff --git a/frontend/src/pages/queries/buildTimelineStages.test.ts b/frontend/src/pages/queries/buildTimelineStages.test.ts index 3f6d4eb8..ca37faaa 100644 --- a/frontend/src/pages/queries/buildTimelineStages.test.ts +++ b/frontend/src/pages/queries/buildTimelineStages.test.ts @@ -1,3 +1,4 @@ +import type { TFunction } from 'i18next'; import { describe, expect, it } from 'vitest'; import { buildTimelineStages } from './buildTimelineStages'; import type { @@ -8,8 +9,10 @@ import type { } from '@/types/api'; // Echoes the key plus its interpolation, so tests assert the shape without pinning English copy. -const t = (key: string, options?: Record) => - options ? `${key}:${Object.entries(options).map(([k, v]) => `${k}=${String(v)}`).join(',')}` : key; +const t = ((key: string, options?: Record) => + options + ? `${key}:${Object.entries(options).map(([k, v]) => `${k}=${String(v)}`).join(',')}` + : key) as unknown as TFunction; function reviewer(id: string, displayName: string | null, email: string) { return { id, email, display_name: displayName as string }; diff --git a/frontend/src/pages/queries/buildTimelineStages.ts b/frontend/src/pages/queries/buildTimelineStages.ts index 75a464dc..93e37f27 100644 --- a/frontend/src/pages/queries/buildTimelineStages.ts +++ b/frontend/src/pages/queries/buildTimelineStages.ts @@ -2,9 +2,9 @@ import type { TimelineStage } from '@/components/review/ApprovalTimeline'; import type { QueryDetail, ReviewDecisionDetail } from '@/types/api'; import { fmtDate, fmtNum } from '@/utils/dateFormat'; import { userDisplay } from '@/utils/userDisplay'; +import type { TFunction } from 'i18next'; -/** i18next's `t`, narrowed to what this builder needs — key plus optional interpolation. */ -type Translate = (key: string, options?: Record) => string; +type Translate = TFunction; export function buildTimelineStages( query: QueryDetail,