From b821c78d202a1a46a14962e25073cd1ab5ee9221 Mon Sep 17 00:00:00 2001 From: Codemod Bot Date: Thu, 12 Dec 2024 19:00:36 +0000 Subject: [PATCH] feat: Apply i18n codemods --- apps/web/app/locales/en.json | 4 + apps/web/app/not-found.tsx | 7 +- .../(admin-layout)/admin/locales/en.json | 3 + .../settings/(admin-layout)/admin/page.tsx | 7 +- .../admin/users/locales/en.json | 3 + .../(admin-layout)/admin/users/page.tsx | 5 +- apps/web/components/EnterprisePage.tsx | 6 +- apps/web/components/apps/AppPage.tsx | 7 +- .../apps/installation/ConfigureStepCard.tsx | 23 ++-- .../apps/installation/EventTypesStepCard.tsx | 19 ++- .../apps/installation/locales/en.json | 7 + apps/web/components/apps/locales/en.json | 3 + apps/web/components/auth/BackupCode.tsx | 7 +- apps/web/components/auth/locales/en.json | 4 + .../components/booking/BookingListItem.tsx | 5 +- apps/web/components/booking/locales/en.json | 3 + apps/web/components/dialog/RerouteDialog.tsx | 9 +- .../components/dialog/RescheduleDialog.tsx | 5 +- apps/web/components/dialog/locales/en.json | 5 + .../steps-views/UserProfile.tsx | 5 +- .../steps-views/locales/en.json | 3 + apps/web/components/locales/en.json | 3 + .../security/EnableTwoFactorModal.tsx | 5 +- apps/web/components/security/locales/en.json | 3 + .../settings/CustomEmailTextField.tsx | 5 +- .../settings/EnableTwoFactorModal.tsx | 5 +- apps/web/components/settings/locales/en.json | 3 + .../platform/dashboard/NoPlatformPlan.tsx | 17 +-- .../platform/dashboard/locales/en.json | 6 + .../dashboard/managed-user-header/index.tsx | 11 +- .../managed-user-header/locales/en.json | 4 + .../dashboard/managed-user-table/index.tsx | 9 +- .../managed-user-table/locales/en.json | 5 + .../dashboard/oauth-clients-list/index.tsx | 13 +- .../oauth-clients-list/locales/en.json | 5 + .../oauth-clients/OAuthClientCard.tsx | 42 +++--- .../platform/oauth-clients/locales/en.json | 16 +++ .../oauth-clients/oauth-client-form/index.tsx | 31 +++-- .../oauth-client-form/locales/en.json | 12 ++ .../platform/pricing/billing-card/index.tsx | 12 +- .../pricing/billing-card/locales/en.json | 4 + .../pricing/platform-pricing/index.tsx | 5 +- .../pricing/platform-pricing/locales/en.json | 3 + apps/web/components/setup/ChooseLicense.tsx | 5 +- .../components/setup/EnterpriseLicense.tsx | 15 ++- apps/web/components/setup/locales/en.json | 5 + .../UsernameAvailability/PremiumTextfield.tsx | 10 +- .../ui/UsernameAvailability/locales/en.json | 4 + apps/web/components/ui/form/MinutesField.tsx | 7 +- apps/web/components/ui/form/locales/en.json | 3 + apps/web/lib/QueryCell.tsx | 5 +- apps/web/lib/locales/en.json | 3 + apps/web/modules/apps/[slug]/locales/en.json | 3 + .../modules/apps/[slug]/setup/locales/en.json | 3 + .../modules/apps/[slug]/setup/setup-view.tsx | 6 +- apps/web/modules/apps/[slug]/slug-view.tsx | 14 +- .../forgot-password/forgot-password-view.tsx | 6 +- .../auth/forgot-password/locales/en.json | 3 + apps/web/modules/auth/locales/en.json | 10 ++ apps/web/modules/auth/login-view.tsx | 16 ++- .../modules/auth/oauth2/authorize-view.tsx | 8 +- apps/web/modules/auth/oauth2/locales/en.json | 4 + .../modules/auth/platform/authorize-view.tsx | 19 ++- .../web/modules/auth/platform/locales/en.json | 6 + apps/web/modules/auth/signin-view.tsx | 6 +- apps/web/modules/auth/verify-view.tsx | 20 +-- .../bookings/views/bookings-single-view.tsx | 20 +-- .../modules/bookings/views/locales/en.json | 9 ++ .../connect-and-join-view.tsx | 13 +- .../modules/connect-and-join/locales/en.json | 3 + .../views/event-types-listing-view.tsx | 20 ++- .../modules/event-types/views/locales/en.json | 7 + apps/web/modules/locales/en.json | 13 ++ apps/web/modules/maintenance/locales/en.json | 5 + .../modules/maintenance/maintenance-view.tsx | 13 +- .../settings/admin/components/UsersTable.tsx | 19 ++- .../settings/admin/components/locales/en.json | 6 + .../modules/settings/admin/locales/en.json | 13 ++ .../settings/admin/locked-sms-view.tsx | 16 +-- .../web/modules/settings/admin/oauth-view.tsx | 18 ++- .../settings/my-account/locales/en.json | 5 + .../settings/my-account/profile-view.tsx | 12 +- .../platform/billing/billing-view.tsx | 12 +- .../settings/platform/billing/locales/en.json | 5 + .../modules/settings/platform/locales/en.json | 5 + .../[clientId]/edit/edit-view.tsx | 12 +- .../[clientId]/edit/edit-webhooks-view.tsx | 8 +- .../[clientId]/edit/locales/en.json | 7 + .../oauth-clients/create-new-view.tsx | 6 +- .../platform/oauth-clients/locales/en.json | 3 + .../settings/platform/plans/locales/en.json | 5 + .../platform/plans/platform-plans-view.tsx | 12 +- .../settings/platform/platform-view.tsx | 10 +- apps/web/modules/signup-view.tsx | 30 ++--- apps/web/modules/upgrade/locales/en.json | 4 + apps/web/modules/upgrade/upgrade-view.tsx | 8 +- apps/web/modules/videos/views/locales/en.json | 5 + .../videos-meeting-ended-single-view.tsx | 8 +- .../videos/views/videos-single-view.tsx | 8 +- apps/web/pages/404.tsx | 10 +- apps/web/pages/500.tsx | 7 +- apps/web/pages/icons.tsx | 12 +- apps/web/pages/locales/en.json | 10 ++ example-apps/credential-sync/pages/index.tsx | 18 ++- .../credential-sync/pages/locales/en.json | 6 + .../src/components/AppCreateUpdateForm.tsx | 41 +++--- .../src/components/DeleteForm.tsx | 11 +- .../src/components/locales/en.json | 20 +++ .../components/BookingConfirmationForm.tsx | 13 +- .../src/components/CallToActionIcon.tsx | 11 +- .../emails/src/components/EmailBodyLogo.tsx | 5 +- .../components/EmailSchedulingBodyHeader.tsx | 5 +- .../emails/src/components/locales/en.json | 6 + .../AdminOrganizationNotificationEmail.tsx | 22 ++-- .../src/templates/AttendeeAddGuestsEmail.tsx | 11 +- .../AttendeeAwaitingPaymentEmail.tsx | 7 +- .../src/templates/AttendeeCancelledEmail.tsx | 11 +- .../templates/AttendeeCancelledSeatEmail.tsx | 11 +- .../templates/AttendeeLocationChangeEmail.tsx | 11 +- .../templates/AttendeeRescheduledEmail.tsx | 11 +- .../src/templates/AttendeeUpdatedEmail.tsx | 11 +- .../AttendeeWasRequestedToRescheduleEmail.tsx | 7 +- .../src/templates/BrokenIntegrationEmail.tsx | 32 +++-- .../DailyVideoDownloadRecordingEmail.tsx | 13 +- .../DailyVideoDownloadTranscriptEmail.tsx | 9 +- .../emails/src/templates/FeedbackEmail.tsx | 11 +- .../src/templates/MonthlyDigestEmail.tsx | 5 +- .../src/templates/OrgAutoInviteEmail.tsx | 5 +- .../templates/OrganizationAdminNoSlots.tsx | 24 ++-- .../templates/OrganizationCreationEmail.tsx | 59 +++++---- .../src/templates/OrganizerAddGuestsEmail.tsx | 11 +- .../OrganizerAttendeeCancelledSeatEmail.tsx | 11 +- .../src/templates/OrganizerCancelledEmail.tsx | 11 +- .../OrganizerLocationChangeEmail.tsx | 11 +- .../OrganizerPaymentRefundFailedEmail.tsx | 6 +- .../templates/OrganizerReassignedEmail.tsx | 5 +- .../OrganizerRequestReminderEmail.tsx | 11 +- .../templates/OrganizerRescheduledEmail.tsx | 11 +- .../src/templates/SlugReplacementEmail.tsx | 30 ++--- .../emails/src/templates/TeamInviteEmail.tsx | 124 ++++++++++-------- packages/emails/src/templates/locales/en.json | 71 ++++++++++ .../base/src/components/Navbar/index.tsx | 21 +-- .../src/components/Navbar/locales/en.json | 10 ++ .../examples/base/src/pages/[bookingUid].tsx | 35 +++-- .../examples/base/src/pages/booking.tsx | 13 +- .../examples/base/src/pages/bookings.tsx | 9 +- .../examples/base/src/pages/embed.tsx | 5 +- .../examples/base/src/pages/event-types.tsx | 14 +- .../examples/base/src/pages/index.tsx | 13 +- .../examples/base/src/pages/locales/en.json | 29 ++++ .../components/app-list-card/AppListCard.tsx | 6 +- .../components/app-list-card/locales/en.json | 3 + packages/ui/components/apps/AppCard.tsx | 6 +- packages/ui/components/apps/locales/en.json | 3 + packages/ui/components/card/Card.tsx | 5 +- packages/ui/components/card/locales/en.json | 3 + packages/ui/components/dialog/dialog.test.tsx | 7 +- packages/ui/components/dialog/locales/en.json | 4 + .../editor/plugins/ToolbarPlugin.test.tsx | 11 +- .../components/editor/plugins/locales/en.json | 3 + .../errorBoundary/error-boundary.test.tsx | 5 +- .../components/errorBoundary/locales/en.json | 3 + .../ui/components/filter-select/index.tsx | 7 +- .../components/filter-select/locales/en.json | 3 + .../form/color-picker/colorpicker.tsx | 6 +- .../form/color-picker/locales/en.json | 3 + .../date-range-picker/DateRangePicker.tsx | 8 +- .../form/date-range-picker/locales/en.json | 4 + packages/ui/components/form/step/FormStep.tsx | 6 +- .../ui/components/form/step/locales/en.json | 3 + .../form/timezone-select/TimezoneSelect.tsx | 6 +- .../form/timezone-select/locales/en.json | 3 + .../form/toggleGroup/BooleanToggleGroup.tsx | 12 +- .../form/toggleGroup/locales/en.json | 4 + packages/ui/components/icon/SatSymbol.tsx | 5 +- packages/ui/components/icon/locales/en.json | 3 + packages/ui/components/logo/Logo.tsx | 9 +- packages/ui/components/logo/locales/en.json | 6 + .../navigation/tabs/HorizontalTabItem.tsx | 5 +- .../navigation/tabs/locales/en.json | 3 + .../ui/components/table/TableExamples.tsx | 47 ++++--- packages/ui/components/table/locales/en.json | 17 +++ packages/ui/form/fields.tsx | 5 +- packages/ui/form/locales/en.json | 3 + 184 files changed, 1403 insertions(+), 590 deletions(-) create mode 100644 apps/web/app/locales/en.json create mode 100644 apps/web/app/settings/(admin-layout)/admin/locales/en.json create mode 100644 apps/web/app/settings/(admin-layout)/admin/users/locales/en.json create mode 100644 apps/web/components/apps/installation/locales/en.json create mode 100644 apps/web/components/apps/locales/en.json create mode 100644 apps/web/components/auth/locales/en.json create mode 100644 apps/web/components/booking/locales/en.json create mode 100644 apps/web/components/dialog/locales/en.json create mode 100644 apps/web/components/getting-started/steps-views/locales/en.json create mode 100644 apps/web/components/locales/en.json create mode 100644 apps/web/components/security/locales/en.json create mode 100644 apps/web/components/settings/locales/en.json create mode 100644 apps/web/components/settings/platform/dashboard/locales/en.json create mode 100644 apps/web/components/settings/platform/dashboard/managed-user-header/locales/en.json create mode 100644 apps/web/components/settings/platform/dashboard/managed-user-table/locales/en.json create mode 100644 apps/web/components/settings/platform/dashboard/oauth-clients-list/locales/en.json create mode 100644 apps/web/components/settings/platform/oauth-clients/locales/en.json create mode 100644 apps/web/components/settings/platform/oauth-clients/oauth-client-form/locales/en.json create mode 100644 apps/web/components/settings/platform/pricing/billing-card/locales/en.json create mode 100644 apps/web/components/settings/platform/pricing/platform-pricing/locales/en.json create mode 100644 apps/web/components/setup/locales/en.json create mode 100644 apps/web/components/ui/UsernameAvailability/locales/en.json create mode 100644 apps/web/components/ui/form/locales/en.json create mode 100644 apps/web/lib/locales/en.json create mode 100644 apps/web/modules/apps/[slug]/locales/en.json create mode 100644 apps/web/modules/apps/[slug]/setup/locales/en.json create mode 100644 apps/web/modules/auth/forgot-password/locales/en.json create mode 100644 apps/web/modules/auth/locales/en.json create mode 100644 apps/web/modules/auth/oauth2/locales/en.json create mode 100644 apps/web/modules/auth/platform/locales/en.json create mode 100644 apps/web/modules/bookings/views/locales/en.json create mode 100644 apps/web/modules/connect-and-join/locales/en.json create mode 100644 apps/web/modules/event-types/views/locales/en.json create mode 100644 apps/web/modules/locales/en.json create mode 100644 apps/web/modules/maintenance/locales/en.json create mode 100644 apps/web/modules/settings/admin/components/locales/en.json create mode 100644 apps/web/modules/settings/admin/locales/en.json create mode 100644 apps/web/modules/settings/my-account/locales/en.json create mode 100644 apps/web/modules/settings/platform/billing/locales/en.json create mode 100644 apps/web/modules/settings/platform/locales/en.json create mode 100644 apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/locales/en.json create mode 100644 apps/web/modules/settings/platform/oauth-clients/locales/en.json create mode 100644 apps/web/modules/settings/platform/plans/locales/en.json create mode 100644 apps/web/modules/upgrade/locales/en.json create mode 100644 apps/web/modules/videos/views/locales/en.json create mode 100644 apps/web/pages/locales/en.json create mode 100644 example-apps/credential-sync/pages/locales/en.json create mode 100644 packages/app-store-cli/src/components/locales/en.json create mode 100644 packages/emails/src/components/locales/en.json create mode 100644 packages/emails/src/templates/locales/en.json create mode 100644 packages/platform/examples/base/src/components/Navbar/locales/en.json create mode 100644 packages/platform/examples/base/src/pages/locales/en.json create mode 100644 packages/ui/components/app-list-card/locales/en.json create mode 100644 packages/ui/components/apps/locales/en.json create mode 100644 packages/ui/components/card/locales/en.json create mode 100644 packages/ui/components/dialog/locales/en.json create mode 100644 packages/ui/components/editor/plugins/locales/en.json create mode 100644 packages/ui/components/errorBoundary/locales/en.json create mode 100644 packages/ui/components/filter-select/locales/en.json create mode 100644 packages/ui/components/form/color-picker/locales/en.json create mode 100644 packages/ui/components/form/date-range-picker/locales/en.json create mode 100644 packages/ui/components/form/step/locales/en.json create mode 100644 packages/ui/components/form/timezone-select/locales/en.json create mode 100644 packages/ui/components/form/toggleGroup/locales/en.json create mode 100644 packages/ui/components/icon/locales/en.json create mode 100644 packages/ui/components/logo/locales/en.json create mode 100644 packages/ui/components/navigation/tabs/locales/en.json create mode 100644 packages/ui/components/table/locales/en.json create mode 100644 packages/ui/form/locales/en.json diff --git a/apps/web/app/locales/en.json b/apps/web/app/locales/en.json new file mode 100644 index 00000000000000..b7f7bf1a58182f --- /dev/null +++ b/apps/web/app/locales/en.json @@ -0,0 +1,4 @@ +{ + "404-page-not-found": "404 - Page Not Found", + "sorry-the-page-you-are-looking-for-does-not-exist": "Sorry, the page you are looking for does not exist." +} diff --git a/apps/web/app/not-found.tsx b/apps/web/app/not-found.tsx index a9a4bb5c9251f3..f3f33daf41a48b 100644 --- a/apps/web/app/not-found.tsx +++ b/apps/web/app/not-found.tsx @@ -1,10 +1,13 @@ +import { useTranslation } from "react-i18next"; import React from "react"; const NotFound = () => { +const { t } = useTranslation(); + return (
-

404 - Page Not Found

-

Sorry, the page you are looking for does not exist.

+

{t('404-page-not-found')}

+

{t('sorry-the-page-you-are-looking-for-does-not-exist')}

); }; diff --git a/apps/web/app/settings/(admin-layout)/admin/locales/en.json b/apps/web/app/settings/(admin-layout)/admin/locales/en.json new file mode 100644 index 00000000000000..7490971931f642 --- /dev/null +++ b/apps/web/app/settings/(admin-layout)/admin/locales/en.json @@ -0,0 +1,3 @@ +{ + "admin-index": "Admin index" +} diff --git a/apps/web/app/settings/(admin-layout)/admin/page.tsx b/apps/web/app/settings/(admin-layout)/admin/page.tsx index 4f4fb938eca887..00935e8684d82d 100644 --- a/apps/web/app/settings/(admin-layout)/admin/page.tsx +++ b/apps/web/app/settings/(admin-layout)/admin/page.tsx @@ -1,3 +1,4 @@ +import { useTranslation } from "react-i18next"; import { _generateMetadata } from "app/_utils"; export const generateMetadata = async () => @@ -6,5 +7,9 @@ export const generateMetadata = async () => () => "" ); -const Page = () =>

Admin index

; +const Page = () => { +const { t } = useTranslation(); + +return

{t('admin-index')}

+}; export default Page; diff --git a/apps/web/app/settings/(admin-layout)/admin/users/locales/en.json b/apps/web/app/settings/(admin-layout)/admin/users/locales/en.json new file mode 100644 index 00000000000000..0e8ec5d3612200 --- /dev/null +++ b/apps/web/app/settings/(admin-layout)/admin/users/locales/en.json @@ -0,0 +1,3 @@ +{ + "add-user": "Add user" +} diff --git a/apps/web/app/settings/(admin-layout)/admin/users/page.tsx b/apps/web/app/settings/(admin-layout)/admin/users/page.tsx index 178b22b6cc59b2..55a65172d4e69b 100644 --- a/apps/web/app/settings/(admin-layout)/admin/users/page.tsx +++ b/apps/web/app/settings/(admin-layout)/admin/users/page.tsx @@ -1,3 +1,4 @@ +import { useTranslation } from "react-i18next"; import { _generateMetadata, getTranslate } from "app/_utils"; import UsersListingView from "@calcom/features/ee/users/pages/users-listing-view"; @@ -11,6 +12,8 @@ export const generateMetadata = async () => ); const Page = async () => { +const { t } = useTranslation(); + const t = await getTranslate(); return ( {
{/* TODO: Add import users functionality */} {/* */} - +
}> diff --git a/apps/web/components/EnterprisePage.tsx b/apps/web/components/EnterprisePage.tsx index 43f2f202ba4555..2054002c972848 100644 --- a/apps/web/components/EnterprisePage.tsx +++ b/apps/web/components/EnterprisePage.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslation } from "react-i18next"; + import { ShellMain } from "@calcom/features/shell/Shell"; import { UpgradeTip } from "@calcom/features/tips"; @@ -6,6 +8,8 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Button, ButtonGroup, Icon } from "@calcom/ui"; export default function EnterprisePage() { +const { t } = useTranslation(); + const { t } = useLocale(); const features = [ @@ -61,7 +65,7 @@ export default function EnterprisePage() { }> - <>Create Org + <>{t('create-org')} diff --git a/apps/web/components/apps/AppPage.tsx b/apps/web/components/apps/AppPage.tsx index 8294a0dff77118..d8193840d1d98f 100644 --- a/apps/web/components/apps/AppPage.tsx +++ b/apps/web/components/apps/AppPage.tsx @@ -1,3 +1,4 @@ +import { useTranslation } from "react-i18next"; import Link from "next/link"; import { useRouter } from "next/navigation"; import type { IframeHTMLAttributes } from "react"; @@ -74,6 +75,8 @@ export const AppPage = ({ concurrentMeetings, paid, }: AppPageProps) => { +const { t } = useTranslation(); + const { t, i18n } = useLocale(); const router = useRouter(); const searchParams = useCompatSearchParams(); @@ -234,9 +237,7 @@ export const AppPage = ({ {isTemplate && ( - - Template - Available in Dev Environment only for testing - + {t('template-available-in-dev-environment-only-for-testing')} )} diff --git a/apps/web/components/apps/installation/ConfigureStepCard.tsx b/apps/web/components/apps/installation/ConfigureStepCard.tsx index 1df0c1490b58cc..5c5214025aa0a2 100644 --- a/apps/web/components/apps/installation/ConfigureStepCard.tsx +++ b/apps/web/components/apps/installation/ConfigureStepCard.tsx @@ -1,3 +1,4 @@ +import { useTranslation } from "react-i18next"; import { zodResolver } from "@hookform/resolvers/zod"; import type { Dispatch, SetStateAction } from "react"; import type { FC } from "react"; @@ -60,6 +61,8 @@ type TUpdatedEventTypesStatus = { id: number; updated: boolean }[][]; const EventTypeAppSettingsForm = forwardRef( function EventTypeAppSettingsForm(props, ref) { +const { t } = useTranslation(); + const { handleDelete, onSubmit, eventType, loading, isConferencing } = props; const { t } = useLocale(); @@ -107,9 +110,7 @@ const EventTypeAppSettingsForm = forwardRef !loading && handleDelete()} /> - + @@ -186,6 +187,8 @@ const EventTypeGroup = ({ }; export const ConfigureStepCard: FC = (props) => { +const { t } = useTranslation(); + const { loading, formPortalRef, handleSetUpLater } = props; const { t } = useLocale(); const { control, watch } = useFormContext(); @@ -222,12 +225,15 @@ export const ConfigureStepCard: FC = (props) => { formPortalRef?.current && createPortal(
- {fields.map((group, groupIndex) => ( + {fields.map((group, groupIndex) => { +const { t } = useTranslation(); + +return (
{eventTypeGroups[groupIndex].eventTypes.some((eventType) => eventType.selected === true) && (
= (props) => { {...props} />
- ))} - + ) +})} +