diff --git a/src/components/AB/TestWrapper.tsx b/src/components/AB/TestWrapper.tsx index 47a0a81c861..34b1f6f4e61 100644 --- a/src/components/AB/TestWrapper.tsx +++ b/src/components/AB/TestWrapper.tsx @@ -1,7 +1,10 @@ +import { getLocale } from "next-intl/server" import type { ReactNode } from "react" import { IS_PREVIEW_DEPLOY, IS_PROD } from "@/lib/utils/env" +import { DEFAULT_LOCALE } from "@/lib/constants" + import { ClientABTestWrapper } from "./ClientABTestWrapper" import { ABTestDebugPanel } from "./TestDebugPanel" import { ABTestTracker } from "./TestTracker" @@ -13,13 +16,19 @@ type ABTestWrapperProps = { testKey: string variants: ABTestVariants fallback?: ReactNode + enableAllLocales?: boolean } const ABTestWrapper = async ({ testKey, variants, fallback, + enableAllLocales, }: ABTestWrapperProps) => { + const locale = await getLocale() + if (locale !== DEFAULT_LOCALE && !enableAllLocales) + return <>{fallback || variants[0]}> + try { // Get deterministic assignment const assignment = await getABTestAssignment(testKey) diff --git a/src/components/FeedbackCard.tsx b/src/components/FeedbackCard.tsx index 563a7f652f8..09993defda0 100644 --- a/src/components/FeedbackCard.tsx +++ b/src/components/FeedbackCard.tsx @@ -69,7 +69,9 @@ const FeedbackCard = ({ prompt, isArticle, ...props }: FeedbackCardProps) => { dir={dir} >
{t("feedback-widget-thank-you-subtitle")}{" "}