From 126ed17da984e356fe4fb3d5e1fdfc2dd5a87fe1 Mon Sep 17 00:00:00 2001 From: Codemod Bot Date: Tue, 4 Nov 2025 21:03:26 +0000 Subject: [PATCH] [DRAFT] refactor: Run i18n-pro-codemod Campaign shard --- .../components/ui/SpacingTable.tsx | 12 +- .../content/design/components/alert.basic.tsx | 12 +- .../design/components/avatar.indicator.tsx | 14 +- .../content/design/components/badge.dots.tsx | 12 +- .../design/components/button.icons.tsx | 34 ++- .../design/components/checkbox.basic.tsx | 18 +- .../design/components/dialog.basic.tsx | 13 +- .../components/dropdown.avatarTrigger.tsx | 22 +- .../design/components/emptyScreen.border.tsx | 22 +- .../content/design/components/form.addOns.tsx | 20 +- .../content/design/components/input.types.tsx | 12 +- .../components/multiInputField.paste.tsx | 23 +- .../design/components/rangeslider.basic.tsx | 13 +- .../design/components/section.withIcon.tsx | 9 +- .../design/components/select.field.tsx | 24 ++- .../content/design/components/switch.tsx | 34 ++- .../design/components/textarea.sizes.tsx | 20 +- .../settings/platform/members/layout.tsx | 5 +- messages/en.json | 197 ++++++++++++++++++ .../ui/components/filter-select/index.tsx | 7 +- .../navigation/tabs/HorizontalTabItem.tsx | 5 +- 21 files changed, 412 insertions(+), 116 deletions(-) create mode 100644 messages/en.json diff --git a/apps/ui-playground/components/ui/SpacingTable.tsx b/apps/ui-playground/components/ui/SpacingTable.tsx index 6d8f296a63079f..86d2af6faf62e9 100644 --- a/apps/ui-playground/components/ui/SpacingTable.tsx +++ b/apps/ui-playground/components/ui/SpacingTable.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslations } from "next-intl"; + import React from "react"; import { Toaster } from "react-hot-toast"; @@ -19,14 +21,17 @@ export const SpacingTable: React.FC = ({ tokens }) => {
- {tokens.map((token, index) => ( + {tokens.map((token, index) => { +const t = useTranslations("spacing-table"); + +return (

- {token.name === "px" ? "px" : `${token.name} (${token.pixels})`} + {token.name === "px" ? t('token.display-format_0') : t('token.display-format_1', { "tokenName": token.name, "tokenPixels": token.pixels })}

@@ -37,7 +42,8 @@ export const SpacingTable: React.FC = ({ tokens }) => {
- ))} + ) +})}
diff --git a/apps/ui-playground/content/design/components/alert.basic.tsx b/apps/ui-playground/content/design/components/alert.basic.tsx index b42cffd50bf3c9..af128f0859feff 100644 --- a/apps/ui-playground/content/design/components/alert.basic.tsx +++ b/apps/ui-playground/content/design/components/alert.basic.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; @@ -9,14 +11,18 @@ const severities = ["neutral", "info", "warning", "error"] as const; export const BasicExample: React.FC = () => (
- {severities.map((severity) => ( + {severities.map((severity) => { +const t = useTranslations("alert-basic-demo"); + +return ( - ))} + ) +})}
); diff --git a/apps/ui-playground/content/design/components/avatar.indicator.tsx b/apps/ui-playground/content/design/components/avatar.indicator.tsx index 25f41bad280010..4bb10e0e5f397f 100644 --- a/apps/ui-playground/content/design/components/avatar.indicator.tsx +++ b/apps/ui-playground/content/design/components/avatar.indicator.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; @@ -6,20 +8,24 @@ import { Avatar } from "@calcom/ui/components/avatar"; const sampleImage = "https://cal.com/stakeholder/peer.jpg"; -export const IndicatorExample: React.FC = () => ( +export const IndicatorExample: React.FC = () => { +const t = useTranslations("avatar-indicator-demo"); + +return (
} /> - With Status Indicator + {t('labels.status-indicator-description')}
-); +) +}; diff --git a/apps/ui-playground/content/design/components/badge.dots.tsx b/apps/ui-playground/content/design/components/badge.dots.tsx index 7f39362a50fd80..8dd5056e13f241 100644 --- a/apps/ui-playground/content/design/components/badge.dots.tsx +++ b/apps/ui-playground/content/design/components/badge.dots.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; @@ -20,14 +22,18 @@ const variants = [ export const DotsExample: React.FC = () => (
- {variants.map((variant) => ( + {variants.map((variant) => { +const t = useTranslations("badge-dots-demo"); + +return (
{variant} - Dot + {t('labels.dot-indicator')}
- ))} + ) +})}
); diff --git a/apps/ui-playground/content/design/components/button.icons.tsx b/apps/ui-playground/content/design/components/button.icons.tsx index 1c1b24c1e33de5..81ca20fe344ac8 100644 --- a/apps/ui-playground/content/design/components/button.icons.tsx +++ b/apps/ui-playground/content/design/components/button.icons.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; import { Row } from "@/app/components/row"; @@ -7,36 +9,48 @@ import { Button } from "@calcom/ui/components/button"; const colors = ["primary", "secondary", "minimal", "destructive"] as const; -export const IconsExample: React.FC = () => ( +export const IconsExample: React.FC = () => { +const t = useTranslations("button-icons-demo"); + +return (
-

Start Icon

+

{t('sections.start-icon-heading')}

- {colors.map((color) => ( + {colors.map((color) => { +const t = useTranslations("button-icons-demo"); + +return (
- Start Icon + {t('labels.start-icon-caption')}
- ))} + ) +})}
-

End Icon

+

{t('sections.end-icon-heading')}

- {colors.map((color) => ( + {colors.map((color) => { +const t = useTranslations("button-icons-demo"); + +return (
- End Icon + {t('labels.end-icon-caption')}
- ))} + ) +})}
-); +) +}; diff --git a/apps/ui-playground/content/design/components/checkbox.basic.tsx b/apps/ui-playground/content/design/components/checkbox.basic.tsx index e8f353f9cecfa7..ee863aa4c3f85e 100644 --- a/apps/ui-playground/content/design/components/checkbox.basic.tsx +++ b/apps/ui-playground/content/design/components/checkbox.basic.tsx @@ -1,31 +1,37 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; import { Checkbox } from "@calcom/ui/components/form"; -export const BasicExample: React.FC = () => ( +export const BasicExample: React.FC = () => { +const t = useTranslations("checkbox-basic-demo"); + +return (
- Unchecked + {t('states.unchecked')}
- Checked + {t('states.checked')}
- Disabled + {t('states.disabled')}
- Disabled Checked + {t('states.disabled-checked')}
-); +) +}; diff --git a/apps/ui-playground/content/design/components/dialog.basic.tsx b/apps/ui-playground/content/design/components/dialog.basic.tsx index 6c5eb0a568df97..7e368c3e9f026f 100644 --- a/apps/ui-playground/content/design/components/dialog.basic.tsx +++ b/apps/ui-playground/content/design/components/dialog.basic.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; import { useState } from "react"; @@ -7,23 +9,22 @@ import { Button } from "@calcom/ui/components/button"; import { Dialog, DialogClose, DialogContent, DialogFooter } from "@calcom/ui/components/dialog"; export const BasicExample: React.FC = () => { +const t = useTranslations("dialog-basic-demo"); + const [open, setOpen] = useState(false); return (
- + -

- Dialogs are used to display content that requires user attention or interaction. They appear - above the page content and must be closed before interacting with the page again. -

+

{t('content.description')}

- +
diff --git a/apps/ui-playground/content/design/components/dropdown.avatarTrigger.tsx b/apps/ui-playground/content/design/components/dropdown.avatarTrigger.tsx index 1b980fa104fc1c..b182712157901b 100644 --- a/apps/ui-playground/content/design/components/dropdown.avatarTrigger.tsx +++ b/apps/ui-playground/content/design/components/dropdown.avatarTrigger.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; @@ -12,27 +14,31 @@ import { DropdownMenuSeparator, } from "@calcom/ui/components/dropdown"; -export const AvatarTriggerExample: React.FC = () => ( +export const AvatarTriggerExample: React.FC = () => { +const t = useTranslations("dropdown-avatar-trigger"); + +return (
- Profile + {t('menu.profile-label')} - View Profile - Settings + {t('menu.view-profile')} + {t('menu.settings')} - Sign out + {t('menu.sign-out')} - Avatar Menu + {t('demo.caption')}
-); +) +}; diff --git a/apps/ui-playground/content/design/components/emptyScreen.border.tsx b/apps/ui-playground/content/design/components/emptyScreen.border.tsx index f7c5d987fd84f7..2b9562e589e2e1 100644 --- a/apps/ui-playground/content/design/components/emptyScreen.border.tsx +++ b/apps/ui-playground/content/design/components/emptyScreen.border.tsx @@ -1,20 +1,25 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; import { EmptyScreen } from "@calcom/ui/components/empty-screen"; -export const BorderExample: React.FC = () => ( +export const BorderExample: React.FC = () => { +const t = useTranslations("empty-screen-border-demo"); + +return (
{/* Without Border */}
-

Without Border

+

{t('sections.without-border')}

alert("Browse Apps clicked")} border={false} /> @@ -22,16 +27,17 @@ export const BorderExample: React.FC = () => ( {/* With Solid Border */}
-

With Solid Border

+

{t('sections.with-solid-border')}

alert("Compose clicked")} dashedBorder={false} />
-); +) +}; diff --git a/apps/ui-playground/content/design/components/form.addOns.tsx b/apps/ui-playground/content/design/components/form.addOns.tsx index 74883658f132ef..f45d2cbea1bbf2 100644 --- a/apps/ui-playground/content/design/components/form.addOns.tsx +++ b/apps/ui-playground/content/design/components/form.addOns.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; import { useForm } from "react-hook-form"; @@ -14,6 +16,8 @@ type FormValues = { }; export const AddOnsExample: React.FC = () => { +const t = useTranslations("form-addons-demo"); + const form = useForm({ defaultValues: { website: "", @@ -30,36 +34,32 @@ export const AddOnsExample: React.FC = () => {
} {...form.register("githubUsername")} error={form.formState.errors.githubUsername?.message} />
- - + +
diff --git a/apps/ui-playground/content/design/components/input.types.tsx b/apps/ui-playground/content/design/components/input.types.tsx index e9cbc4e3fbe886..b923f449d3d67c 100644 --- a/apps/ui-playground/content/design/components/input.types.tsx +++ b/apps/ui-playground/content/design/components/input.types.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; @@ -15,11 +17,14 @@ export const TypesExample: React.FC = () => (

{type}

- {sizes.map((size) => ( + {sizes.map((size) => { +const t = useTranslations("input-types-demo"); + +return (
( /> {size}
- ))} + ) +})}
))} diff --git a/apps/ui-playground/content/design/components/multiInputField.paste.tsx b/apps/ui-playground/content/design/components/multiInputField.paste.tsx index ea6fe03f96bbb7..dafa6a4966d738 100644 --- a/apps/ui-playground/content/design/components/multiInputField.paste.tsx +++ b/apps/ui-playground/content/design/components/multiInputField.paste.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; import { useForm, FormProvider } from "react-hook-form"; @@ -13,6 +15,8 @@ type FormValues = { }; export const PasteExample: React.FC = () => { +const t = useTranslations("multi-input-field-demo"); + const methods = useForm(); return ( @@ -21,10 +25,8 @@ export const PasteExample: React.FC = () => {
-

Default Delimiters (Newline and Comma)

-

- Try pasting: “Option 1, Option 2” or multiple lines -

+

{t('sections.default-delimiters.title')}

+

{t('sections.default-delimiters.description')}

fieldArrayName="newlineOptions" optionPlaceholders={["Paste here..."]} @@ -33,8 +35,8 @@ export const PasteExample: React.FC = () => {
-

Comma Only Delimiter

-

Try pasting: “First, Second, Third”

+

{t('sections.comma-delimiter.title')}

+

{t('sections.comma-delimiter.description')}

fieldArrayName="commaOptions" optionPlaceholders={["Paste here..."]} @@ -44,9 +46,8 @@ export const PasteExample: React.FC = () => {
-

Key-Value Pair Paste Support

-

- Try pasting: “NODE_ENV=production” or “KEY1:value1, KEY2:value2” +

{t('sections.key-value-pairs.title')}

+

{t('sections.key-value-pairs.description')}

fieldArrayName="keyValueOptions" @@ -59,8 +60,8 @@ export const PasteExample: React.FC = () => {
-

Custom Delimiters (Semicolon and Pipe)

-

Try pasting: “One;Two|Three”

+

{t('sections.custom-delimiters.title')}

+

{t('sections.custom-delimiters.description')}

fieldArrayName="customOptions" optionPlaceholders={["Paste here..."]} diff --git a/apps/ui-playground/content/design/components/rangeslider.basic.tsx b/apps/ui-playground/content/design/components/rangeslider.basic.tsx index a2908933981d3b..c11a7dd03709ee 100644 --- a/apps/ui-playground/content/design/components/rangeslider.basic.tsx +++ b/apps/ui-playground/content/design/components/rangeslider.basic.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; import { useState } from "react"; @@ -6,6 +8,8 @@ import { useState } from "react"; import { RangeSlider } from "@calcom/ui/components/form"; export const BasicExample: React.FC = () => { +const t = useTranslations("rangeslider-demo"); + const [singleValue, setSingleValue] = useState([50]); const [rangeValue, setRangeValue] = useState([20, 80]); const [steppedValue, setSteppedValue] = useState([25]); @@ -16,7 +20,7 @@ export const BasicExample: React.FC = () => {
- Single Value: {singleValue[0]}% + {t('labels.single-value')}{singleValue[0]}%
{
- - Range: {rangeValue[0]}% - {rangeValue[1]}% + {t('labels.range')}{rangeValue[0]}% - {rangeValue[1]}%
{
- Step Size 25: {steppedValue[0]}% + {t('labels.step-size-25')}{steppedValue[0]}%
{
- Disabled: 50% + {t('labels.disabled')}
diff --git a/apps/ui-playground/content/design/components/section.withIcon.tsx b/apps/ui-playground/content/design/components/section.withIcon.tsx index 7e1e0326305d41..de01faaa88603f 100644 --- a/apps/ui-playground/content/design/components/section.withIcon.tsx +++ b/apps/ui-playground/content/design/components/section.withIcon.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; import { useState } from "react"; @@ -7,6 +9,8 @@ import { Switch } from "@calcom/ui/components/form"; import { Section } from "@calcom/ui/components/section"; export const WithIconExample = () => { +const t = useTranslations("section-with-icon-demo"); + const [isOpen, setIsOpen] = useState(true); return ( @@ -20,10 +24,7 @@ export const WithIconExample = () => { {isOpen && ( -

- This section demonstrates how to include an icon in the header and uses FormKit auto-animate for - smooth transitions when toggling content visibility. -

+

{t('descriptions.icon-animation-feature')}

)} diff --git a/apps/ui-playground/content/design/components/select.field.tsx b/apps/ui-playground/content/design/components/select.field.tsx index d020cfd6bbef39..0b26ca4450d3a7 100644 --- a/apps/ui-playground/content/design/components/select.field.tsx +++ b/apps/ui-playground/content/design/components/select.field.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; @@ -14,6 +16,8 @@ const options = [ ]; export const FieldExample: React.FC = () => { +const t = useTranslations("select-field-demo"); + const handleValueChange = (newValue: unknown, actionMeta: { action: string }) => { showToast(`Selected: ${JSON.stringify(newValue)}, Action: ${actionMeta.action}`, "success"); }; @@ -22,41 +26,41 @@ export const FieldExample: React.FC = () => {
- +
- +
); diff --git a/apps/ui-playground/content/design/components/switch.tsx b/apps/ui-playground/content/design/components/switch.tsx index e4ce1d769bd172..bb222be66b78ee 100644 --- a/apps/ui-playground/content/design/components/switch.tsx +++ b/apps/ui-playground/content/design/components/switch.tsx @@ -1,4 +1,6 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; import { useState } from "react"; @@ -6,49 +8,57 @@ import { useState } from "react"; import { Switch } from "@calcom/ui/components/form"; export const BasicExample = () => { +const t = useTranslations("switch-playground"); + const [checked, setChecked] = useState(false); return (
- +
); }; export const LabelPositionExample = () => { +const t = useTranslations("switch-playground"); + const [checked, setChecked] = useState(false); return (
- - + +
); }; export const StatesExample = () => { +const t = useTranslations("switch-playground"); + return (
- - - + + +
); }; export const ControlledExample = () => { +const t = useTranslations("switch-playground"); + const [checked, setChecked] = useState(false); return (
@@ -58,12 +68,14 @@ export const ControlledExample = () => { }; export const WithPadding = () => { +const t = useTranslations("switch-playground"); + const [checked, setChecked] = useState(false); return (
{ }; export const SwitchSizes = () => { +const t = useTranslations("switch-playground"); + const [checked, setChecked] = useState(false); return (
- - + +
); diff --git a/apps/ui-playground/content/design/components/textarea.sizes.tsx b/apps/ui-playground/content/design/components/textarea.sizes.tsx index 58ad6c4d38267c..f9b6a6bb098941 100644 --- a/apps/ui-playground/content/design/components/textarea.sizes.tsx +++ b/apps/ui-playground/content/design/components/textarea.sizes.tsx @@ -1,30 +1,36 @@ "use client"; +import { useTranslations } from "next-intl"; + import { RenderComponentWithSnippet } from "@/app/components/render"; import { TextAreaField } from "@calcom/ui/components/form"; -export const SizesExample: React.FC = () => ( +export const SizesExample: React.FC = () => { +const t = useTranslations("textarea-sizes-demo"); + +return (
-

Default Height

- +

{t('sections.default-height')}

+
-

Custom Height (6 rows)

- +

{t('sections.custom-height')}

+

Auto-growing

-); +) +}; diff --git a/apps/web/app/(use-page-wrapper)/settings/platform/members/layout.tsx b/apps/web/app/(use-page-wrapper)/settings/platform/members/layout.tsx index 76a42b69f98dfd..16680905d2cb1d 100644 --- a/apps/web/app/(use-page-wrapper)/settings/platform/members/layout.tsx +++ b/apps/web/app/(use-page-wrapper)/settings/platform/members/layout.tsx @@ -1,3 +1,4 @@ +import { getTranslations } from "next-intl/server"; import { getTranslate } from "app/_utils"; import { CTA_CONTAINER_CLASS_NAME } from "@calcom/features/data-table/lib/utils"; @@ -5,13 +6,15 @@ import Shell from "@calcom/features/shell/Shell"; import { Button } from "@calcom/ui/components/button"; export default async function Layout({ children }: { children: React.ReactNode }) { +const t = await getTranslations("platform-members-layout"); + const t = await getTranslate(); return ( -

Member management

+

{t('headings.member-management')}