refactor: extract dedicated @calcom/i18n package (#28141)

This commit is contained in:
Benny Joo authored and GitHub committed 2026-02-23 13:30:12 +00:00
1 parent f00be08e8c
commit 648ad72a54
208 files changed
+548 -459

No files matched your search

+1
View File
@@ -15,6 +15,7 @@
"lint:report": "biome lint --reporter json . > ../../lint-results/testing.json"
},
"dependencies": {
"@calcom/i18n": "workspace:*",
"@calcom/lib": "workspace:*",
"@calcom/prisma": "workspace:*"
},
@@ -1,8 +1,8 @@
import type * as i18n from "@calcom/lib/server/i18n";
import type * as i18n from "@calcom/i18n/server";
import { beforeEach, vi } from "vitest";
import { mockDeep, mockReset } from "vitest-mock-extended";
vi.mock("@calcom/lib/server/i18n", () => i18nMock);
vi.mock("@calcom/i18n/server", () => i18nMock);
beforeEach(() => {
mockReset(i18nMock);
@@ -1,4 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { TFunction } from "i18next";
import i18nMock from "../__mocks__/libServerI18n";
import prismock from "../__mocks__/prisma";
import { v4 as uuidv4 } from "uuid";
@@ -1718,7 +1720,7 @@ export function mockNoTranslations() {
log.silly("Mocking i18n.getTranslation to return identity function");
i18nMock.getTranslation.mockImplementation(() => {
return new Promise((resolve) => {
const identityFn = (key: string) => key;
const identityFn = ((key: string) => key) as TFunction<string, undefined>;
resolve(identityFn);
});
});