bump react-i18next to 18 and fix i18next 27 types

react-i18next 18 peers i18next >= 27.0.1, so the two move together.
i18next 27's TFunction no longer fits the hand-written t signatures in
the config form, and it rejects undefined as the options argument.
This commit is contained in:
Josh Hawkins
2026-11-15 11:31:51 -06:00
parent e857074fd0
commit 055b4622cc
7 changed files with 25 additions and 38 deletions
@@ -5,6 +5,7 @@
* for RJSF form fields.
*/
import type { TFunction } from "i18next";
import type { ConfigFormContext } from "@/types/configForm";
import { getEffectiveAttributeLabels } from "@/utils/configUtil";
@@ -70,13 +71,13 @@ export function buildTranslationPath(
*/
export function resolveConfigTranslation(
i18n: { exists: (key: string, opts?: Record<string, unknown>) => boolean },
t: (key: string, opts?: Record<string, unknown>) => string,
t: TFunction,
translationPath: string,
suffix: "label" | "description",
sectionI18nPrefix?: string,
ns?: string,
): string | undefined {
const opts = ns ? { ns } : undefined;
const opts = ns ? { ns } : {};
if (
sectionI18nPrefix &&