refactor: extract dedicated @calcom/i18n package (#28141)
This commit is contained in:
1 parent
f00be08e8c
commit
648ad72a54
208 files changed
+548
-459
No files matched your search
@@ -10,7 +10,7 @@ import { BookingSeatRepository } from "@calcom/features/bookings/repositories/Bo
|
||||
import { getBookerBaseUrl } from "@calcom/features/ee/organizations/lib/getBookerUrlServer";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import prisma from "@calcom/prisma";
|
||||
import { SchedulingType, WorkflowActions, WorkflowTemplates } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -10,7 +10,7 @@ import { CreditService } from "@calcom/features/ee/billing/credit-service";
|
||||
import { getBookerBaseUrl } from "@calcom/features/ee/organizations/lib/getBookerUrlServer";
|
||||
import { isAttendeeAction } from "@calcom/features/ee/workflows/lib/actionHelperFunctions";
|
||||
import { scheduleSmsOrFallbackEmail } from "@calcom/features/ee/workflows/lib/reminders/messageDispatcher";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import prisma from "@calcom/prisma";
|
||||
import { WorkflowActions, WorkflowMethods, WorkflowTemplates } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -5,7 +5,7 @@ import { NextResponse } from "next/server";
|
||||
import dayjs from "@calcom/dayjs";
|
||||
import { BookingSeatRepository } from "@calcom/features/bookings/repositories/BookingSeatRepository";
|
||||
import { CreditService } from "@calcom/features/ee/billing/credit-service";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import prisma from "@calcom/prisma";
|
||||
import { WorkflowActions, WorkflowMethods } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -17,7 +17,7 @@ vi.mock("@calcom/features/ee/workflows/lib/reminders/providers/emailProvider", (
|
||||
sendOrScheduleWorkflowEmails: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => {
|
||||
vi.mock("@calcom/i18n/server", () => {
|
||||
return {
|
||||
getTranslation: async (locale: string, namespace: string) => {
|
||||
const t = (key: string) => key;
|
||||
|
||||
@@ -14,7 +14,7 @@ import type { Workflow, WorkflowStep } from "@calcom/features/ee/workflows/lib/t
|
||||
import { WorkflowReminderRepository } from "@calcom/features/ee/workflows/repositories/WorkflowReminderRepository";
|
||||
import { formatCalEventExtended } from "@calcom/lib/formatCalendarEvent";
|
||||
import { withReporting } from "@calcom/lib/sentryWrapper";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { checkSMSRateLimit } from "@calcom/lib/smsLockState";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
import { SchedulingType } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -9,7 +9,7 @@ import { getSubmitterEmail } from "@calcom/features/tasker/tasks/triggerFormSubm
|
||||
import { SENDER_ID } from "@calcom/lib/constants";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import type { PrismaClient } from "@calcom/prisma";
|
||||
import prisma from "@calcom/prisma";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import dayjs from "@calcom/dayjs";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import prisma from "@calcom/prisma";
|
||||
import {
|
||||
WorkflowTriggerEvents,
|
||||
|
||||
@@ -22,7 +22,7 @@ vi.mock("@calcom/features/profile/lib/hideBranding", () => ({
|
||||
getHideBranding: vi.fn().mockResolvedValue(false),
|
||||
}));
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => ({
|
||||
vi.mock("@calcom/i18n/server", () => ({
|
||||
getTranslation: vi.fn().mockResolvedValue((key: string) => key),
|
||||
}));
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { getVideoCallUrlFromCalEvent } from "@calcom/lib/CalEventParser";
|
||||
import { SENDER_NAME, WEBSITE_URL } from "@calcom/lib/constants";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { TimeFormat } from "@calcom/lib/timeFormat";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
import { WorkflowActions, WorkflowTemplates } from "@calcom/prisma/enums";
|
||||
import { SchedulingType, WorkflowTriggerEvents } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
|
||||
import { deleteMultipleScheduledSMS } from "../reminders/providers/twilioProvider";
|
||||
import { WorkflowOptOutContactRepository } from "../repository/workflowOptOutContact";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { vi, expect, test, describe } from "vitest";
|
||||
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { TimeFormat } from "@calcom/lib/timeFormat";
|
||||
import { WorkflowActions, WorkflowTemplates } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -28,7 +28,7 @@ const tMock = (key: string) => {
|
||||
return mocks[key] || key;
|
||||
};
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => {
|
||||
vi.mock("@calcom/i18n/server", () => {
|
||||
return {
|
||||
getTranslation: async (locale: string, namespace: string) => {
|
||||
const t = tMock as any;
|
||||
|
||||
Reference in new issue
Block a user