diff --git a/apps/web/components/settings/platform/pricing/billing-card/index.tsx b/apps/web/components/settings/platform/pricing/billing-card/index.tsx index 34e7773838..930b677f84 100644 --- a/apps/web/components/settings/platform/pricing/billing-card/index.tsx +++ b/apps/web/components/settings/platform/pricing/billing-card/index.tsx @@ -1,3 +1,4 @@ +import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Button } from "@calcom/ui/components/button"; type PlatformBillingCardProps = { @@ -19,6 +20,7 @@ export const PlatformBillingCard = ({ handleSubscribe, currentPlan, }: PlatformBillingCardProps) => { + const { t } = useLocale(); return (
@@ -30,7 +32,7 @@ export const PlatformBillingCard = ({ type="button" StartIcon="circle-check" className="bg-default hover:bg-default cursor-none text-green-500 hover:cursor-pointer" - tooltip="This is your current plan" + tooltip={t("this_is_your_current_plan")} /> )} @@ -39,7 +41,7 @@ export const PlatformBillingCard = ({

{pricing !== undefined && ( <> - US${pricing} per month + US${pricing} {t("per_month")} )}

@@ -50,12 +52,12 @@ export const PlatformBillingCard = ({ loading={isLoading} onClick={handleSubscribe} className="flex w-[100%] items-center justify-center"> - {pricing !== undefined ? "Subscribe" : "Schedule a time"} + {pricing !== undefined ? t("subscribe") : t("schedule_a_time")}
)}
-

This includes:

+

{t("this_includes")}

{includes.map((feature) => { return (
diff --git a/apps/web/modules/apps/categories/[category]/category-view.tsx b/apps/web/modules/apps/categories/[category]/category-view.tsx index 7631b0ee2a..1ccd2e8805 100644 --- a/apps/web/modules/apps/categories/[category]/category-view.tsx +++ b/apps/web/modules/apps/categories/[category]/category-view.tsx @@ -29,7 +29,7 @@ export default function Apps({ apps, category }: CategoryDataProps) { {category && ( -  /  + {t("slash_separator")} {t("category_apps", { category: category[0].toUpperCase() + category?.slice(1) })} )} diff --git a/apps/web/modules/auth/verify-view.tsx b/apps/web/modules/auth/verify-view.tsx index bf3f5fc95d..9e2bc88234 100644 --- a/apps/web/modules/auth/verify-view.tsx +++ b/apps/web/modules/auth/verify-view.tsx @@ -8,16 +8,17 @@ import z from "zod"; import { WEBAPP_URL } from "@calcom/lib/constants"; import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams"; +import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useRouterQuery } from "@calcom/lib/hooks/useRouterQuery"; import { trpc } from "@calcom/trpc/react"; -import { showToast } from "@calcom/ui/components/toast"; -import { Button } from "@calcom/ui/components/button"; import classNames from "@calcom/ui/classNames"; +import { Button } from "@calcom/ui/components/button"; import { Icon } from "@calcom/ui/components/icon"; +import { showToast } from "@calcom/ui/components/toast"; import Loader from "@components/Loader"; -async function sendVerificationLogin(email: string, username: string) { +async function sendVerificationLogin(email: string, username: string, t: (key: string) => string) { await signIn("email", { email: email.toLowerCase(), username: username.toLowerCase(), @@ -25,7 +26,7 @@ async function sendVerificationLogin(email: string, username: string) { callbackUrl: WEBAPP_URL || "https://app.cal.com", }) .then(() => { - showToast("Verification email sent", "success"); + showToast(t("verification_email_sent"), "success"); }) .catch((err) => { showToast(err, "error"); @@ -40,15 +41,16 @@ function useSendFirstVerificationLogin({ username: string | undefined; }) { const sent = useRef(false); + const { t } = useLocale(); useEffect(() => { if (!email || !username || sent.current) { return; } (async () => { - await sendVerificationLogin(email, username); + await sendVerificationLogin(email, username, t); sent.current = true; })(); - }, [email, username]); + }, [email, username, t]); } const querySchema = z.object({ @@ -117,7 +119,8 @@ export default function Verify({ EMAIL_FROM }: { EMAIL_FROM?: string }) { const pathname = usePathname(); const router = useRouter(); const routerQuery = useRouterQuery(); - const { t, sessionId, stripeCustomerId } = querySchema.parse(routerQuery); + const { t: tParam, sessionId, stripeCustomerId } = querySchema.parse(routerQuery); + const { t } = useLocale(); const [secondsLeft, setSecondsLeft] = useState(30); const { data } = trpc.viewer.public.stripeCheckoutSession.useQuery( { @@ -166,7 +169,7 @@ export default function Verify({ EMAIL_FROM }: { EMAIL_FROM?: string }) { } if (!stripeCustomerId && !sessionId) { - return
Invalid Link
; + return
{t("invalid_link")}
; } return ( @@ -176,18 +179,15 @@ export default function Verify({ EMAIL_FROM }: { EMAIL_FROM?: string }) { {hasPaymentFailed ? : sessionId ? : }

{hasPaymentFailed - ? "Your payment failed" + ? t("your_payment_failed") : sessionId - ? "Payment successful!" - : "Check your Inbox"} + ? t("payment_successful") + : t("check_your_inbox")}

- {hasPaymentFailed && ( -

Your account has been created, but your premium has not been reserved.

- )} + {hasPaymentFailed &&

{t("account_created_premium_not_reserved")}

}

- We have sent an email to {customer?.email} with a link to activate your account.{" "} - {hasPaymentFailed && - "Once you activate your account you will be able to try purchase your premium username again or select a different one."} + {t("email_sent_with_activation_link", { email: customer?.email })}{" "} + {hasPaymentFailed && t("activate_account_to_purchase_username")}

-

Don’t seen an email?

+

{t("dont_see_email")}

diff --git a/apps/web/modules/maintenance/maintenance-view.tsx b/apps/web/modules/maintenance/maintenance-view.tsx index e1a7116123..c993ffc5fa 100644 --- a/apps/web/modules/maintenance/maintenance-view.tsx +++ b/apps/web/modules/maintenance/maintenance-view.tsx @@ -1,18 +1,17 @@ "use client"; import { WEBSITE_URL } from "@calcom/lib/constants"; +import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Button } from "@calcom/ui/components/button"; export default function MaintenancePage() { + const { t } = useLocale(); return (
-

Down for maintenance

-

- The Cal.com team are performing scheduled maintenance. If you have any questions, please contact - support. -

- +

{t("down_for_maintenance")}

+

{t("maintenance_message")}

+
); diff --git a/apps/web/modules/settings/admin/components/UsersTable.tsx b/apps/web/modules/settings/admin/components/UsersTable.tsx index aa3cf71a3c..d4dd2d32d9 100644 --- a/apps/web/modules/settings/admin/components/UsersTable.tsx +++ b/apps/web/modules/settings/admin/components/UsersTable.tsx @@ -1,5 +1,6 @@ import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage"; import { getUserAvatarUrl } from "@calcom/lib/getAvatarUrl"; +import { useLocale } from "@calcom/lib/hooks/useLocale"; import { SMSLockState } from "@calcom/prisma/client"; import { trpc } from "@calcom/trpc/react"; import { Avatar } from "@calcom/ui/components/avatar"; @@ -51,6 +52,7 @@ const LockStatusTable = ({ teams?: Team[]; setSMSLockState: (param: { userId?: number; teamId?: number; lock: boolean }) => void; }) => { + const { t } = useLocale(); function getActions({ user, team }: { user?: User; team?: Team }) { const smsLockState = user?.smsLockState ?? team?.smsLockState; if (!smsLockState) return []; @@ -89,10 +91,10 @@ const LockStatusTable = ({ <>
- User/Team - Status + {t("user_team")} + {t("status")} - Edit + {t("edit")}
diff --git a/apps/web/modules/settings/admin/oauth-view.tsx b/apps/web/modules/settings/admin/oauth-view.tsx index 1ebae2efe3..5e0575936a 100644 --- a/apps/web/modules/settings/admin/oauth-view.tsx +++ b/apps/web/modules/settings/admin/oauth-view.tsx @@ -5,12 +5,12 @@ import { useForm } from "react-hook-form"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc"; -import { ImageUploader } from "@calcom/ui/components/image-uploader"; import { Avatar } from "@calcom/ui/components/avatar"; import { Button } from "@calcom/ui/components/button"; import { Form } from "@calcom/ui/components/form"; import { TextField } from "@calcom/ui/components/form"; import { Icon } from "@calcom/ui/components/icon"; +import { ImageUploader } from "@calcom/ui/components/image-uploader"; import { showToast } from "@calcom/ui/components/toast"; import { Tooltip } from "@calcom/ui/components/tooltip"; @@ -95,7 +95,7 @@ export default function OAuthView() { ) : (
{oAuthForm.getValues("name")}
-
Client Id
+
{t("client_id")}
{" "} @@ -105,7 +105,7 @@ export default function OAuthView() {
{clientSecret ? ( <> -
Client Secret
+
{t("client_secret")}
{" "} @@ -127,7 +127,7 @@ export default function OAuthView() { onClick={() => { navigator.clipboard.writeText(clientSecret); setClientSecret(""); - showToast("Client secret copied!", "success"); + showToast(t("client_secret_copied"), "success"); }} type="button" className="rounded-l-none text-base" diff --git a/apps/web/modules/settings/platform/billing/billing-view.tsx b/apps/web/modules/settings/platform/billing/billing-view.tsx index ceb12a9299..951a7e8e26 100644 --- a/apps/web/modules/settings/platform/billing/billing-view.tsx +++ b/apps/web/modules/settings/platform/billing/billing-view.tsx @@ -38,7 +38,7 @@ export default function PlatformBillingUpgrade() { useGetUserAttributes(); if (isUserLoading || (isUserBillingDataLoading && !userBillingData)) { - return
Loading...
; + return
{t("loading")}
; } if (isPlatformUser && !isPaidUser) @@ -47,7 +47,7 @@ export default function PlatformBillingUpgrade() { teamId={userOrgId} heading={
-

Subscribe to Platform

+

{t("subscribe_to_platform")}

} /> diff --git a/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-view.tsx b/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-view.tsx index 55dcf99aca..4b56805e5e 100644 --- a/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-view.tsx +++ b/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-view.tsx @@ -28,7 +28,7 @@ export default function EditOAuthClient() { const { data, isFetched, isFetching, isError, refetch } = useOAuthClient(clientId); const { mutateAsync: update, isPending: isUpdating } = useUpdateOAuthClient({ onSuccess: () => { - showToast("OAuth client updated successfully", "success"); + showToast(t("oauth_client_updated_successfully"), "success"); refetch(); router.push("/settings/platform/"); }, @@ -63,7 +63,7 @@ export default function EditOAuthClient() { }); }; - if (isUserLoading) return
Loading...
; + if (isUserLoading) return
{t("loading")}
; if (isPlatformUser && isPaidUser) { return ( @@ -80,7 +80,7 @@ export default function EditOAuthClient() {

- {(!Boolean(clientId) || (isFetched && !data)) &&

OAuth Client not found.

} + {(!Boolean(clientId) || (isFetched && !data)) &&

{t("oauth_client_not_found")}

} {isFetched && !!data && ( )} - {isFetching &&

Loading...

} - {isError &&

Something went wrong.

} + {isFetching &&

{t("loading")}

} + {isError &&

{t("something_went_wrong")}

} diff --git a/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view.tsx b/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view.tsx index f497cb5209..166731c623 100644 --- a/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view.tsx +++ b/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view.tsx @@ -37,7 +37,7 @@ export default function EditOAuthClientWebhooks() { const { mutateAsync: createWebhook } = useCreateOAuthClientWebhook(clientId); const { mutateAsync: updateWebhook } = useUpdateOAuthClientWebhook(clientId); - if (isUserLoading) return
Loading...
; + if (isUserLoading) return
{t("loading")}
; if (isPlatformUser && isPaidUser) { return ( @@ -55,7 +55,7 @@ export default function EditOAuthClientWebhooks() { - {webhooksStatus !== "success" &&

Error while trying to access webhooks.

} + {webhooksStatus !== "success" &&

{t("error_accessing_webhooks")}

} {isWebhooksFetched && webhooksStatus === "success" && ( { diff --git a/apps/web/modules/settings/platform/oauth-clients/create-new-view.tsx b/apps/web/modules/settings/platform/oauth-clients/create-new-view.tsx index d916612582..15e2e8b420 100644 --- a/apps/web/modules/settings/platform/oauth-clients/create-new-view.tsx +++ b/apps/web/modules/settings/platform/oauth-clients/create-new-view.tsx @@ -59,7 +59,7 @@ export default function CreateOAuthClient() { }); }; - if (isUserLoading) return
Loading...
; + if (isUserLoading) return
{t("loading")}
; if (isPlatformUser && isPaidUser) { return ( diff --git a/apps/web/modules/settings/platform/plans/platform-plans-view.tsx b/apps/web/modules/settings/platform/plans/platform-plans-view.tsx index 4f08fcf037..77605eea08 100644 --- a/apps/web/modules/settings/platform/plans/platform-plans-view.tsx +++ b/apps/web/modules/settings/platform/plans/platform-plans-view.tsx @@ -1,17 +1,19 @@ "use client"; import Shell from "@calcom/features/shell/Shell"; +import { useLocale } from "@calcom/lib/hooks/useLocale"; import NoPlatformPlan from "@components/settings/platform/dashboard/NoPlatformPlan"; import { useGetUserAttributes } from "@components/settings/platform/hooks/useGetUserAttributes"; import { PlatformPricing } from "@components/settings/platform/pricing/platform-pricing"; export default function PlatformPlans() { + const { t } = useLocale(); const { isUserLoading, isUserBillingDataLoading, isPlatformUser, isPaidUser, userBillingData, userOrgId } = useGetUserAttributes(); if (isUserLoading || (isUserBillingDataLoading && !userBillingData)) { - return
Loading...
; + return
{t("loading")}
; } if (!isPlatformUser) return ; @@ -23,8 +25,10 @@ export default function PlatformPlans() { isPlatformUser={true} heading={

- You are currently subscribed to {userBillingData?.plan[0]} - {userBillingData?.plan.slice(1).toLocaleLowerCase()} plan + {t("currently_subscribed_to_plan", { + planFirstLetter: userBillingData?.plan[0], + planRest: userBillingData?.plan.slice(1).toLocaleLowerCase(), + })}

} withoutMain={false} diff --git a/apps/web/modules/settings/platform/platform-view.tsx b/apps/web/modules/settings/platform/platform-view.tsx index 7027962ecc..aad541ac17 100644 --- a/apps/web/modules/settings/platform/platform-view.tsx +++ b/apps/web/modules/settings/platform/platform-view.tsx @@ -44,10 +44,10 @@ export default function Platform() { setInitialClientName(data[0]?.name); }, [data]); - if (isUserLoading || isOAuthClientLoading) return
Loading...
; + if (isUserLoading || isOAuthClientLoading) return
{t("loading")}
; if (isUserBillingDataLoading && !userBillingData) { - return
Loading...
; + return
{t("loading")}
; } if (isPlatformUser && !isPaidUser) @@ -56,7 +56,7 @@ export default function Platform() { teamId={userOrgId} heading={
-

Subscribe to Platform

+

{t("subscribe_to_platform")}

} /> diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index 681492edf4..b998bf38c8 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -3080,5 +3080,34 @@ "disable_delegation_credential_description": "Once delegation credential is disabled, organization members who haven’t connected their calendars will need to do so manually.", "salesforce_on_cancel_write_to_event": "On cancelled booking, write to event record instead of deleting event", "salesforce_on_every_cancellation": "On every cancellation", + "this_is_your_current_plan": "This is your current plan", + "per_month": "per month", + "schedule_a_time": "Schedule a time", + "this_includes": "This includes:", + "oauth_client_updated_successfully": "OAuth client updated successfully", + "oauth_client_not_found": "OAuth Client not found.", + "subscribe_to_platform": "Subscribe to Platform", + "error_accessing_webhooks": "Error while trying to access webhooks.", + "slash_separator": " / ", + "webhook_update_failed": "Failed to update webhook.", + "webhook_create_failed": "Failed to create webhook.", + "invalid_link": "Invalid Link", + "currently_subscribed_to_plan": "You are currently subscribed to {{planFirstLetter}}{{planRest}} plan", + "user_team": "User/Team", + "client_id_copied": "Client ID copied!", + "client_secret_copied": "Client secret copied!", + "down_for_maintenance": "Down for maintenance", + "maintenance_message": "The Cal.com team are performing scheduled maintenance. If you have any questions, please contact support.", + "your_payment_failed": "Your payment failed", + "payment_successful": "Payment successful!", + "check_your_inbox": "Check your Inbox", + "account_created_premium_not_reserved": "Your account has been created, but your premium has not been reserved.", + "email_sent_with_activation_link": "We have sent an email to {{email}} with a link to activate your account.", + "activate_account_to_purchase_username": "Once you activate your account you will be able to try purchase your premium username again or select a different one.", + "open_in_gmail": "Open in Gmail", + "dont_see_email": "Don't seen an email?", + "resend_in_seconds": "Resend in {{seconds}} seconds", + "resend": "Resend", + "verification_email_sent": "Verification email sent", "ADD_NEW_STRINGS_ABOVE_THIS_LINE_TO_PREVENT_MERGE_CONFLICTS": "↑↑↑↑↑↑↑↑↑↑↑↑↑ Add your new strings above here ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑" }