@@ -377,7 +411,7 @@ const VersionsList: FC
= ({ onRestore, branch }) => {
},
},
{
- title: t("version_diff.changes"),
+ title: versionDiffT(t, "changes"),
key: "changes",
render: (_, record) => renderChangeSummary(diffsById.get(record.id)),
},
@@ -410,8 +444,8 @@ const VersionsList: FC = ({ onRestore, branch }) => {
diff={diff}
caption={
diff?.isInitial
- ? t("version_diff.initial_version")
- : t("version_diff.compared_to_previous")
+ ? versionDiffT(t, "initial_version")
+ : versionDiffT(t, "compared_to_previous")
}
loading={fetching}
/>
@@ -434,11 +468,11 @@ const VersionsList: FC = ({ onRestore, branch }) => {
{totalCount > 1 && (
- {t("version_diff.compare")}
+ {versionDiffT(t, "compare")}
)}
{compareFromId && compareToId && compareFromId === compareToId && (
- {t("version_diff.same_version")}
+
+ {versionDiffT(t, "same_version")}
+
)}
{compareDiff && (
)}
@@ -485,7 +521,7 @@ const VersionsList: FC = ({ onRestore, branch }) => {
/>
setRestoreTarget(null)}
zIndex={2000}
width={920}
@@ -499,13 +535,13 @@ const VersionsList: FC = ({ onRestore, branch }) => {
onClick={confirmRestore}
data-testid="confirm-restore"
>
- {t("version_diff.confirm_restore")}
+ {versionDiffT(t, "confirm_restore")}
,
]}
>
diff --git a/tests.setup.ts b/tests.setup.ts
index 881fb520..44d166cd 100644
--- a/tests.setup.ts
+++ b/tests.setup.ts
@@ -31,7 +31,8 @@ vi.mock("react-i18next", () => ({
// this mock makes sure any components using the translate hook can use it without a warning being shown
useTranslation: () => {
return {
- t: (str: string) => str,
+ t: (str: string, options?: { defaultValue?: string }) =>
+ options?.defaultValue ?? str,
i18n: {
changeLanguage: () => new Promise(() => {}),
language: "en",