Skip to content

The open alternative to Salesforce, designed for AI.

Translate component labels with useLingui so they follow locale changes (#29614)

Charles Bochetbf0dad4e0bc0
diff --git a/packages/twenty-front/setupTests.ts b/packages/twenty-front/setupTests.ts
index 61f0edd12a1..34244f84d35 100644
--- a/packages/twenty-front/setupTests.ts
+++ b/packages/twenty-front/setupTests.ts
@@ -13,6 +13,22 @@ import { messages as enMessages } from '~/locales/generated/en';
i18n.load({ [SOURCE_LOCALE]: enMessages });
i18n.activate(SOURCE_LOCALE);
+// Most tests mount components without I18nProvider; fall back to the global i18n above.
+jest.mock('@lingui/react', () => {
+ const actual = jest.requireActual('@lingui/react');
+ const { useContext } = jest.requireActual('react');
+ const { i18n: globalI18n } = jest.requireActual('@lingui/core');
+ const fallbackContext = {
+ i18n: globalI18n,
+ _: globalI18n.t.bind(globalI18n),
+ };
+
+ return {
+ ...actual,
+ useLingui: () => useContext(actual.LinguiContext) ?? fallbackContext,
+ };
+});
+
// jsdom lacks TextEncoder/TextDecoder, which @ai-sdk/provider-utils builds at import.
if (globalThis.TextDecoder === undefined) {
Object.assign(globalThis, { TextDecoder, TextEncoder });
diff --git a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerFields.tsx b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerFields.tsx
index b1cb06bcb90..183b7f6fef2 100644
--- a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerFields.tsx
+++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerFields.tsx
@@ -19,11 +19,11 @@ import { DND_KIT_SENSORS } from '@/ui/utilities/drag-and-drop/constants/DndKitSe
import { DragDropItemDndContext } from '@/ui/utilities/drag-and-drop/context/DragDropItemDndContext';
import { DragDropProvider } from '@dnd-kit/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { Callout } from 'twenty-ui/components/feedback';
import { Input, Switch } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledFieldsContainer = styled.div`
display: flex;
@@ -59,6 +59,7 @@ export const CalendarEventComposerFields = ({
onAddAccount,
onReauthorize,
}: CalendarEventComposerFieldsProps) => {
+ const { t } = useLingui();
const recipientsByFieldId: EmailRecipientsByFieldId = {
to: composerState.attendees,
cc: [],
diff --git a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerTargetsInput.tsx b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerTargetsInput.tsx
index 5577ac98bd6..2ea8a85fc89 100644
--- a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerTargetsInput.tsx
+++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerTargetsInput.tsx
@@ -12,12 +12,12 @@ import { IconButton } from 'twenty-ui/components/input';
import { OverflowingList } from 'twenty-ui/components/layout';
import { Dropdown } from 'twenty-ui/components/navigation';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type MouseEvent, useId, useState } from 'react';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { IconPlus } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledClickableContainer = styled.div`
align-items: center;
@@ -43,6 +43,7 @@ export const CalendarEventComposerTargetsInput = ({
targets,
onTargetChange,
}: CalendarEventComposerTargetsInputProps) => {
+ const { t } = useLingui();
const componentId = useId();
const dropdownId = `calendar-event-composer-targets-${componentId}`;
diff --git a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventRow.tsx b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventRow.tsx
index ed7c8aa6447..7e5daf65050 100644
--- a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventRow.tsx
+++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventRow.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { format } from 'date-fns';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import {
@@ -17,6 +16,7 @@ import { useOpenCalendarEventInSidePanel } from '@/side-panel/hooks/useOpenCalen
import { IconArrowRight } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
type CalendarEventRowProps = {
calendarEvent: TimelineCalendarEvent;
@@ -75,6 +75,7 @@ export const CalendarEventRow = ({
calendarEvent,
className,
}: CalendarEventRowProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
const { openCalendarEventInSidePanel } = useOpenCalendarEventInSidePanel();
diff --git a/packages/twenty-front/src/modules/activities/calendar/hooks/useComposeCalendarEventRelatedRecordAction.ts b/packages/twenty-front/src/modules/activities/calendar/hooks/useComposeCalendarEventRelatedRecordAction.ts
index f81896b8050..e6855af1b73 100644
--- a/packages/twenty-front/src/modules/activities/calendar/hooks/useComposeCalendarEventRelatedRecordAction.ts
+++ b/packages/twenty-front/src/modules/activities/calendar/hooks/useComposeCalendarEventRelatedRecordAction.ts
@@ -2,14 +2,15 @@ import { useComposeCalendarEventForTargetRecord } from '@/activities/calendar/ho
import { type ActivityTargetableObject } from '@/activities/types/ActivityTargetableEntity';
import { type RelatedRecordActionBinding } from '@/activities/types/RelatedRecordAction';
import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
-import { t } from '@lingui/core/macro';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { IconCalendarEvent } from 'twenty-ui/icon';
import { PermissionFlagType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useComposeCalendarEventRelatedRecordAction = (
targetRecord: ActivityTargetableObject,
): RelatedRecordActionBinding => {
+ const { t } = useLingui();
const { openComposer, disabled, loading } =
useComposeCalendarEventForTargetRecord(targetRecord);
const canCreateCalendarEvent = useHasPermissionFlag(
diff --git a/packages/twenty-front/src/modules/activities/components/CustomResolverFetchMoreLoader.tsx b/packages/twenty-front/src/modules/activities/components/CustomResolverFetchMoreLoader.tsx
index b234fcd96a9..b28160ada9c 100644
--- a/packages/twenty-front/src/modules/activities/components/CustomResolverFetchMoreLoader.tsx
+++ b/packages/twenty-front/src/modules/activities/components/CustomResolverFetchMoreLoader.tsx
@@ -1,7 +1,7 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useInView } from 'react-intersection-observer';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type CustomResolverFetchMoreLoaderProps = {
loading: boolean;
@@ -26,6 +26,7 @@ export const CustomResolverFetchMoreLoader = ({
loading,
onLastRowVisible,
}: CustomResolverFetchMoreLoaderProps) => {
+ const { t } = useLingui();
const { ref: tbodyRef } = useInView({
onChange: (inView) => {
if (inView) {
diff --git a/packages/twenty-front/src/modules/activities/emails/components/CampaignDetailsFields.tsx b/packages/twenty-front/src/modules/activities/emails/components/CampaignDetailsFields.tsx
index 5d0d7c33ebf..bf747aabe32 100644
--- a/packages/twenty-front/src/modules/activities/emails/components/CampaignDetailsFields.tsx
+++ b/packages/twenty-front/src/modules/activities/emails/components/CampaignDetailsFields.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useId } from 'react';
import {
CoreObjectNameSingular,
@@ -25,6 +24,7 @@ import { FormSingleRecordPicker } from '@/object-record/record-field/ui/form-typ
import { Select } from '@/ui/input/components/Select';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { useOpenDropdown } from '@/ui/layout/dropdown/hooks/useOpenDropdown';
+import { useLingui } from '@lingui/react/macro';
const StyledWarningContainer = styled.div`
padding: ${themeCssVariables.spacing[2]} ${themeCssVariables.spacing[3]};
@@ -40,6 +40,7 @@ type CampaignDetailsFieldsProps = {
export const CampaignDetailsFields = ({
campaign,
}: CampaignDetailsFieldsProps) => {
+ const { t } = useLingui();
const detailsState = useCampaignDetailsState({ campaign });
const instanceId = useId();
const listDropdownId = `campaign-list-picker-${instanceId}`;
diff --git a/packages/twenty-front/src/modules/activities/emails/components/CampaignSentEnvelope.tsx b/packages/twenty-front/src/modules/activities/emails/components/CampaignSentEnvelope.tsx
index ebece2b3452..398789d02f8 100644
--- a/packages/twenty-front/src/modules/activities/emails/components/CampaignSentEnvelope.tsx
+++ b/packages/twenty-front/src/modules/activities/emails/components/CampaignSentEnvelope.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import {
CoreObjectNameSingular,
@@ -18,6 +17,7 @@ import { RecordChip } from '@/object-record/components/RecordChip';
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { dateLocaleState } from '@/localization/states/dateLocaleState';
+import { useLingui } from '@lingui/react/macro';
const StyledValue = styled.span`
color: ${themeCssVariables.font.color.primary};
@@ -40,6 +40,7 @@ type CampaignSentEnvelopeProps = {
export const CampaignSentEnvelope = ({
campaign,
}: CampaignSentEnvelopeProps) => {
+ const { t } = useLingui();
const { unsubscribeTopics, loading: areTopicsLoading } =
useUnsubscribeTopics();
const { timeFormat, timeZone } = useDateTimeFormat();
diff --git a/packages/twenty-front/src/modules/activities/emails/components/CampaignSentPreview.tsx b/packages/twenty-front/src/modules/activities/emails/components/CampaignSentPreview.tsx
index 25af8814a2e..e6eb6cec09f 100644
--- a/packages/twenty-front/src/modules/activities/emails/components/CampaignSentPreview.tsx
+++ b/packages/twenty-front/src/modules/activities/emails/components/CampaignSentPreview.tsx
@@ -1,5 +1,3 @@
-import { t } from '@lingui/core/macro';
-
import { CampaignSentEnvelope } from '@/activities/emails/components/CampaignSentEnvelope';
import { StyledCampaignWidgetContainer } from '@/activities/emails/components/CampaignWidgetContainer';
import { EmailEditorCanvas } from '@/activities/emails/editor/components/EmailEditorCanvas';
@@ -7,22 +5,26 @@ import { CAMPAIGN_BODY_EDITOR_PROFILE } from '@/activities/emails/editor/constan
import { type MessageCampaign } from '@/activities/emails/types/MessageCampaign';
import { FormAdvancedTextFieldInput } from '@/advanced-text-editor/components/FormAdvancedTextFieldInput';
import { StyledWidgetScrollContainer } from '@/ui/layout/components/WidgetContentContainer';
+import { useLingui } from '@lingui/react/macro';
type CampaignSentPreviewProps = {
campaign: MessageCampaign;
};
-export const CampaignSentPreview = ({ campaign }: CampaignSentPreviewProps) => (
- <StyledCampaignWidgetContainer>
- <CampaignSentEnvelope campaign={campaign} />
- <StyledWidgetScrollContainer>
- <FormAdvancedTextFieldInput
- defaultValue={campaign.bodyTemplate}
- readonly
- profile={CAMPAIGN_BODY_EDITOR_PROFILE}
- EditorComponent={EmailEditorCanvas}
- placeholder={t`No content`}
- />
- </StyledWidgetScrollContainer>
- </StyledCampaignWidgetContainer>
-);
+export const CampaignSentPreview = ({ campaign }: CampaignSentPreviewProps) => {
+ const { t } = useLingui();
+ return (
+ <StyledCampaignWidgetContainer>
+ <CampaignSentEnvelope campaign={campaign} />
+ <StyledWidgetScrollContainer>
+ <FormAdvancedTextFieldInput
+ defaultValue={campaign.bodyTemplate}
+ readonly
+ profile={CAMPAIGN_BODY_EDITOR_PROFILE}
+ EditorComponent={EmailEditorCanvas}
+ placeholder={t`No content`}
+ />
+ </StyledWidgetScrollContainer>
+ </StyledCampaignWidgetContainer>
+ );
+};
diff --git a/packages/twenty-front/src/modules/activities/emails/components/EmailComposerFields.tsx b/packages/twenty-front/src/modules/activities/emails/components/EmailComposerFields.tsx
index ffa074fa34b..cf0c7d3f022 100644
--- a/packages/twenty-front/src/modules/activities/emails/components/EmailComposerFields.tsx
+++ b/packages/twenty-front/src/modules/activities/emails/components/EmailComposerFields.tsx
@@ -3,7 +3,6 @@ import { useQuery } from '@apollo/client/react';
import { DragDropProvider } from '@dnd-kit/react';
import { css } from '@linaria/core';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import {
canConnectedAccountPerformEmailOperation,
getSendableEmailHandles,
@@ -37,6 +36,7 @@ import { DND_KIT_PROVIDER_PLUGINS_WITHOUT_DROP_ANIMATION } from '@/ui/utilities/
import { DND_KIT_SENSORS } from '@/ui/utilities/drag-and-drop/constants/DndKitSensors';
import { DragDropItemDndContext } from '@/ui/utilities/drag-and-drop/context/DragDropItemDndContext';
import { GET_MY_CONNECTED_ACCOUNTS } from '@/settings/accounts/graphql/queries/getMyConnectedAccounts';
+import { useLingui } from '@lingui/react/macro';
const StyledFieldsContainer = styled.div`
display: flex;
@@ -83,6 +83,7 @@ export const EmailComposerFields = ({
contextRecord,
onAttachFiles,
}: EmailComposerFieldsProps) => {
+ const { t } = useLingui();
const ccInputRef = useRef<HTMLInputElement>(null);
const { uploadEmailImage } = useUploadEmailImage();
const { data: accountsData } = useQuery<{
diff --git a/packages/twenty-front/src/modules/activities/emails/components/EmailLoader.tsx b/packages/twenty-front/src/modules/activities/emails/components/EmailLoader.tsx
index 68c1cabbd22..ab6168f4891 100644
--- a/packages/twenty-front/src/modules/activities/emails/components/EmailLoader.tsx
+++ b/packages/twenty-front/src/modules/activities/emails/components/EmailLoader.tsx
@@ -1,15 +1,17 @@
import { AnimatedPlaceholder } from '@/ui/feedback/empty-state/components/AnimatedPlaceholder/AnimatedPlaceholder';
import { EmptyState } from '@/ui/feedback/empty-state/components/EmptyState';
-import { t } from '@lingui/core/macro';
-
import { Loader } from 'twenty-ui/primitives/feedback';
+import { useLingui } from '@lingui/react/macro';
-export const EmailLoader = ({ loadingText }: { loadingText?: string }) => (
- <EmptyState.Root>
- <AnimatedPlaceholder type="loadingMessages" />
- <EmptyState.Content>
- <EmptyState.Title>{loadingText || t`Loading emails`}</EmptyState.Title>
- <Loader />
- </EmptyState.Content>
- </EmptyState.Root>
-);
+export const EmailLoader = ({ loadingText }: { loadingText?: string }) => {
+ const { t } = useLingui();
+ return (
+ <EmptyState.Root>
+ <AnimatedPlaceholder type="loadingMessages" />
+ <EmptyState.Content>
+ <EmptyState.Title>{loadingText || t`Loading emails`}</EmptyState.Title>
+ <Loader />
+ </EmptyState.Content>
+ </EmptyState.Root>
+ );
+};
diff --git a/packages/twenty-front/src/modules/activities/emails/components/EmailThreadMessageSender.tsx b/packages/twenty-front/src/modules/activities/emails/components/EmailThreadMessageSender.tsx
index 7c76b5f9570..1525be56211 100644
--- a/packages/twenty-front/src/modules/activities/emails/components/EmailThreadMessageSender.tsx
+++ b/packages/twenty-front/src/modules/activities/emails/components/EmailThreadMessageSender.tsx
@@ -1,6 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
import { ParticipantChip } from '@/activities/components/ParticipantChip';
import { type EmailThreadMessageParticipant } from '@/activities/emails/types/EmailThreadMessageParticipant';
import { TooltipDelay } from '@/ui/layout/tooltip/constants/TooltipDelay';
@@ -13,6 +11,7 @@ import {
formatToHumanReadableDate,
} from '~/utils/date-utils';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
const StyledEmailThreadMessageSender = styled.div`
display: flex;
@@ -41,6 +40,7 @@ export const EmailThreadMessageSender = ({
sender,
sentAt,
}: EmailThreadMessageSenderProps) => {
+ const { t } = useLingui();
const { localeCatalog } = useAtomStateValue(dateLocaleState);
let sentAtContent = null;
diff --git a/packages/twenty-front/src/modules/activities/emails/components/EmailThreadPreview.tsx b/packages/twenty-front/src/modules/activities/emails/components/EmailThreadPreview.tsx
index 720921e263c..11dd22ec4b2 100644
--- a/packages/twenty-front/src/modules/activities/emails/components/EmailThreadPreview.tsx
+++ b/packages/twenty-front/src/modules/activities/emails/components/EmailThreadPreview.tsx
@@ -7,8 +7,6 @@ import { getEmailParticipantAvatarColorSeed } from '@/activities/emails/utils/ge
import { getTimelineThreadLabel } from '@/activities/emails/utils/getTimelineThreadLabel';
import { isChatTimelineThreadChannel } from '@/activities/emails/utils/isChatTimelineThreadChannel';
import { useOpenRecordInSidePanel } from '@/side-panel/hooks/useOpenRecordInSidePanel';
-
-import { t } from '@lingui/core/macro';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { Avatar, Tag } from 'twenty-ui/primitives/data-display';
@@ -19,6 +17,7 @@ import {
} from '~/generated/graphql';
import { formatToHumanReadableDate } from '~/utils/date-utils';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
+import { useLingui } from '@lingui/react/macro';
const StyledHeading = styled.div<{ unread: boolean }>`
display: flex;
@@ -98,6 +97,7 @@ export const EmailThreadPreview = ({
thread,
divider = false,
}: EmailThreadPreviewProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const { openRecordInSidePanel } = useOpenRecordInSidePanel();
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useCancelMessageCampaign.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useCancelMessageCampaign.ts
index da4c7b427ec..b644ebd4291 100644
--- a/packages/twenty-front/src/modules/activities/emails/hooks/useCancelMessageCampaign.ts
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useCancelMessageCampaign.ts
@@ -3,7 +3,7 @@ import { useMutation } from '@apollo/client/react';
import { CANCEL_MESSAGE_CAMPAIGN } from '@/activities/emails/graphql/mutations/cancelMessageCampaign';
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { MessageCampaignStatus } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
@@ -11,8 +11,10 @@ import {
type CancelMessageCampaignMutation,
type CancelMessageCampaignMutationVariables,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useCancelMessageCampaign = () => {
+ const { t } = useLingui();
const [cancelMessageCampaignMutation, { loading }] = useMutation<
CancelMessageCampaignMutation,
CancelMessageCampaignMutationVariables
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useComposeEmailRelatedRecordAction.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useComposeEmailRelatedRecordAction.ts
index c53271a9c9b..8d6bb87ef0e 100644
--- a/packages/twenty-front/src/modules/activities/emails/hooks/useComposeEmailRelatedRecordAction.ts
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useComposeEmailRelatedRecordAction.ts
@@ -2,9 +2,9 @@ import { useComposeEmailForTargetRecord } from '@/activities/emails/hooks/useCom
import { type ActivityTargetableObject } from '@/activities/types/ActivityTargetableEntity';
import { type RelatedRecordActionBinding } from '@/activities/types/RelatedRecordAction';
import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
-import { t } from '@lingui/core/macro';
import { IconMail } from 'twenty-ui/icon';
import { PermissionFlagType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type UseComposeEmailRelatedRecordActionParams = {
targetRecord: ActivityTargetableObject;
@@ -15,6 +15,7 @@ export const useComposeEmailRelatedRecordAction = ({
targetRecord,
isPermissionGated = true,
}: UseComposeEmailRelatedRecordActionParams): RelatedRecordActionBinding => {
+ const { t } = useLingui();
const { openComposer, loading } =
useComposeEmailForTargetRecord(targetRecord);
const canComposeEmail = useHasPermissionFlag(
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/usePersistedCampaignDraft.ts b/packages/twenty-front/src/modules/activities/emails/hooks/usePersistedCampaignDraft.ts
index 216eeab0ba7..080a4637312 100644
--- a/packages/twenty-front/src/modules/activities/emails/hooks/usePersistedCampaignDraft.ts
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/usePersistedCampaignDraft.ts
@@ -1,5 +1,4 @@
import { useApolloClient } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { PREVIEW_MESSAGE_CAMPAIGN_SEND } from '@/activities/emails/graphql/metadata-queries/previewMessageCampaignSend';
@@ -7,6 +6,7 @@ import { type MessageCampaign } from '@/activities/emails/types/MessageCampaign'
import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord';
import { useRecordSeededDraft } from '@/object-record/record-seeded-draft/hooks/useRecordSeededDraft';
import { useToast } from 'twenty-ui/components/feedback';
+import { useLingui } from '@lingui/react/macro';
type UsePersistedCampaignDraftArgs<TDraft extends object> = {
campaignId: string;
@@ -21,6 +21,7 @@ export const usePersistedCampaignDraft = <TDraft extends object>({
initialDraft,
toUpdateOneRecordInput,
}: UsePersistedCampaignDraftArgs<TDraft>) => {
+ const { t } = useLingui();
const { updateOneRecord } = useUpdateOneRecord();
const { enqueueToast } = useToast();
const apolloClient = useApolloClient();
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaign.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaign.ts
index 23c488b2132..cbe875a3f5a 100644
--- a/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaign.ts
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaign.ts
@@ -8,7 +8,7 @@ import { useDateTimeFormat } from '@/localization/hooks/useDateTimeFormat';
import { useNumberFormat } from '@/localization/hooks/useNumberFormat';
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { MessageCampaignStatus } from 'twenty-shared/types';
import { useToast } from 'twenty-ui/components/feedback';
@@ -17,6 +17,7 @@ import {
type SendMessageCampaignMutationVariables,
} from '~/generated-metadata/graphql';
import { dateLocaleState } from '@/localization/states/dateLocaleState';
+import { useLingui } from '@lingui/react/macro';
type SendMessageCampaignParams = {
campaignId: string;
@@ -25,6 +26,7 @@ type SendMessageCampaignParams = {
};
export const useSendMessageCampaign = () => {
+ const { t } = useLingui();
const [sendMessageCampaignMutation, { loading }] = useMutation<
SendMessageCampaignMutation,
SendMessageCampaignMutationVariables
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaignTest.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaignTest.ts
index 2adb6717988..4ec5960dfc8 100644
--- a/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaignTest.ts
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaignTest.ts
@@ -2,12 +2,12 @@ import { useMutation } from '@apollo/client/react';
import { SEND_MESSAGE_CAMPAIGN_TEST } from '@/activities/emails/graphql/mutations/sendMessageCampaignTest';
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
-import { t } from '@lingui/core/macro';
import { useToast } from 'twenty-ui/components/feedback';
import {
type SendMessageCampaignTestMutation,
type SendMessageCampaignTestMutationVariables,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type SendMessageCampaignTestParams = {
toAddress: string;
@@ -18,6 +18,7 @@ type SendMessageCampaignTestParams = {
};
export const useSendMessageCampaignTest = () => {
+ const { t } = useLingui();
const [sendMessageCampaignTestMutation, { loading }] = useMutation<
SendMessageCampaignTestMutation,
SendMessageCampaignTestMutationVariables
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useUploadEmailImage.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useUploadEmailImage.ts
index d16b4631e63..38c173be1d3 100644
--- a/packages/twenty-front/src/modules/activities/emails/hooks/useUploadEmailImage.ts
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useUploadEmailImage.ts
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { EMAIL_IMAGE_MIME_TYPES } from 'twenty-shared/constants';
import { FileFolder } from '~/generated-metadata/graphql';
@@ -9,8 +8,10 @@ import { formatFileSize } from '@/file/utils/formatFileSize';
import { useToast } from 'twenty-ui/components/feedback';
import { logError } from '~/utils/logError';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
export const useUploadEmailImage = () => {
+ const { t } = useLingui();
const { uploadFile } = useDirectFileUpload();
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/modules/activities/emails/recipients/hooks/useEmailRecipientSuggestions.ts b/packages/twenty-front/src/modules/activities/emails/recipients/hooks/useEmailRecipientSuggestions.ts
index 968b1507696..9b8b8c43e5c 100644
--- a/packages/twenty-front/src/modules/activities/emails/recipients/hooks/useEmailRecipientSuggestions.ts
+++ b/packages/twenty-front/src/modules/activities/emails/recipients/hooks/useEmailRecipientSuggestions.ts
@@ -1,5 +1,4 @@
import { type EmailRecipientSuggestion } from '@/activities/emails/recipients/types/EmailRecipientSuggestion';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -16,6 +15,7 @@ import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
import { useObjectRecordSearchRecords } from '@/object-record/hooks/useObjectRecordSearchRecords';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import { useLingui } from '@lingui/react/macro';
type UseEmailRecipientSuggestionsArgs = {
searchInput: string;
@@ -70,6 +70,7 @@ export const useEmailRecipientSuggestions = ({
excludedRecipientKeys,
contextRecord,
}: UseEmailRecipientSuggestionsArgs) => {
+ const { t } = useLingui();
const currentWorkspaceMembers = useAtomStateValue(
currentWorkspaceMembersState,
);
diff --git a/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx b/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx
index b24877f61e6..cb5cecbc93c 100644
--- a/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx
+++ b/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx
@@ -1,6 +1,5 @@
import { FilePreviewDialog } from '@/ui/field/display/components/FilePreviewDialog';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { DropZone } from '@/activities/files/components/DropZone';
@@ -23,6 +22,7 @@ import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
import { PermissionFlagType } from '~/generated-metadata/graphql';
import { AttachmentRow } from './AttachmentRow';
+import { useLingui } from '@lingui/react/macro';
type AttachmentListProps = {
targetableObject: ActivityTargetableObject;
@@ -68,6 +68,7 @@ export const AttachmentList = ({
targetableObject,
attachments,
}: AttachmentListProps) => {
+ const { t } = useLingui();
const { uploadAttachmentFile } = useUploadAttachmentFile();
const [isDraggingFile, setIsDraggingFile] = useState(false);
const [previewedAttachment, setPreviewedAttachment] =
diff --git a/packages/twenty-front/src/modules/activities/files/hooks/useAttachFileRelatedRecordAction.tsx b/packages/twenty-front/src/modules/activities/files/hooks/useAttachFileRelatedRecordAction.tsx
index f02c13a08c4..a31b1baa0f1 100644
--- a/packages/twenty-front/src/modules/activities/files/hooks/useAttachFileRelatedRecordAction.tsx
+++ b/packages/twenty-front/src/modules/activities/files/hooks/useAttachFileRelatedRecordAction.tsx
@@ -2,9 +2,9 @@ import { AttachmentFileInput } from '@/activities/files/components/AttachmentFil
import { useCanUploadAttachmentFiles } from '@/activities/files/hooks/useCanUploadAttachmentFiles';
import { type ActivityTargetableObject } from '@/activities/types/ActivityTargetableEntity';
import { type RelatedRecordActionBinding } from '@/activities/types/RelatedRecordAction';
-import { t } from '@lingui/core/macro';
import { useRef } from 'react';
import { IconPaperclip } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type UseAttachFileRelatedRecordActionParams = {
targetRecord: ActivityTargetableObject;
@@ -15,6 +15,7 @@ export const useAttachFileRelatedRecordAction = ({
targetRecord,
onUploadComplete,
}: UseAttachFileRelatedRecordActionParams): RelatedRecordActionBinding => {
+ const { t } = useLingui();
const { canUploadFiles } = useCanUploadAttachmentFiles(targetRecord);
const inputFileRef = useRef<HTMLInputElement>(null);
diff --git a/packages/twenty-front/src/modules/activities/files/hooks/useUploadAttachmentFile.tsx b/packages/twenty-front/src/modules/activities/files/hooks/useUploadAttachmentFile.tsx
index 3d5ae0352b1..39594f04c1f 100644
--- a/packages/twenty-front/src/modules/activities/files/hooks/useUploadAttachmentFile.tsx
+++ b/packages/twenty-front/src/modules/activities/files/hooks/useUploadAttachmentFile.tsx
@@ -5,11 +5,12 @@ import { useDirectFileUpload } from '@/file/hooks/useDirectFileUpload';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { useCreateOneRecord } from '@/object-record/hooks/useCreateOneRecord';
-import { t } from '@lingui/core/macro';
import { assertIsDefinedOrThrow, isDefined } from 'twenty-shared/utils';
import { FieldMetadataType, FileFolder } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useUploadAttachmentFile = () => {
+ const { t } = useLingui();
const { uploadFile: directUploadFile } = useDirectFileUpload();
const { objectMetadataItem: attachmentMetadata } = useObjectMetadataItem({
objectNameSingular: CoreObjectNameSingular.Attachment,
diff --git a/packages/twenty-front/src/modules/activities/hooks/useCreateActivityRelatedRecordAction.ts b/packages/twenty-front/src/modules/activities/hooks/useCreateActivityRelatedRecordAction.ts
index 322e62653e1..77eea2519a7 100644
--- a/packages/twenty-front/src/modules/activities/hooks/useCreateActivityRelatedRecordAction.ts
+++ b/packages/twenty-front/src/modules/activities/hooks/useCreateActivityRelatedRecordAction.ts
@@ -1,9 +1,9 @@
import { useCreateActivityForTargetRecord } from '@/activities/hooks/useCreateActivityForTargetRecord';
import { type ActivityTargetableObject } from '@/activities/types/ActivityTargetableEntity';
import { type RelatedRecordActionBinding } from '@/activities/types/RelatedRecordAction';
-import { t } from '@lingui/core/macro';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { IconCheckbox, IconNotes } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type UseCreateActivityRelatedRecordActionParams = {
targetRecord: ActivityTargetableObject;
@@ -16,6 +16,7 @@ export const useCreateActivityRelatedRecordAction = ({
targetRecord,
activityObjectNameSingular,
}: UseCreateActivityRelatedRecordActionParams): RelatedRecordActionBinding => {
+ const { t } = useLingui();
const { canCreateActivity, createActivity } =
useCreateActivityForTargetRecord({
targetRecord,
diff --git a/packages/twenty-front/src/modules/activities/notes/components/NoteTile.tsx b/packages/twenty-front/src/modules/activities/notes/components/NoteTile.tsx
index 01068031bf9..2c32eb43651 100644
--- a/packages/twenty-front/src/modules/activities/notes/components/NoteTile.tsx
+++ b/packages/twenty-front/src/modules/activities/notes/components/NoteTile.tsx
@@ -1,6 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
import { useActivityFieldComponentInstanceId } from '@/activities/hooks/useActivityFieldComponentInstanceId';
import { type Note } from '@/activities/types/Note';
import { useObjectMorphJunctionConfigOrThrow } from '@/object-record/record-field/ui/hooks/useObjectMorphJunctionConfigOrThrow';
@@ -12,6 +10,7 @@ import { RecordInlineCell } from '@/object-record/record-inline-cell/components/
import { getRecordFieldInputInstanceId } from '@/object-record/utils/getRecordFieldInputId';
import { getRichTextFieldTextLines } from '@/object-record/record-field/ui/utils/getRichTextFieldTextLines';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledCard = styled.div<{ isSingleNote: boolean }>`
align-items: flex-start;
@@ -74,6 +73,7 @@ export const NoteTile = ({
note: Note;
isSingleNote: boolean;
}) => {
+ const { t } = useLingui();
const { openRecordInSidePanel } = useOpenRecordInSidePanel();
const body = getRichTextFieldTextLines(note?.bodyV2).join('\n');
diff --git a/packages/twenty-front/src/modules/activities/notes/components/NotesCardContent.tsx b/packages/twenty-front/src/modules/activities/notes/components/NotesCardContent.tsx
index 2418f477036..a0e60ef1fcb 100644
--- a/packages/twenty-front/src/modules/activities/notes/components/NotesCardContent.tsx
+++ b/packages/twenty-front/src/modules/activities/notes/components/NotesCardContent.tsx
@@ -5,11 +5,11 @@ import { type Note } from '@/activities/types/Note';
import { AnimatedPlaceholder } from '@/ui/feedback/empty-state/components/AnimatedPlaceholder/AnimatedPlaceholder';
import { EmptyState } from '@/ui/feedback/empty-state/components/EmptyState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconPlus } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
const StyledNotesContainer = styled.div`
display: flex;
@@ -32,6 +32,7 @@ export const NotesCardContent = ({
onCreateNote,
onLastRowVisible,
}: NotesCardContentProps) => {
+ const { t } = useLingui();
const isNotesEmpty = notes.length === 0;
if (loading && isNotesEmpty) {
diff --git a/packages/twenty-front/src/modules/activities/tasks/components/TaskGroupsContent.tsx b/packages/twenty-front/src/modules/activities/tasks/components/TaskGroupsContent.tsx
index 4f4944cd790..edbe065c331 100644
--- a/packages/twenty-front/src/modules/activities/tasks/components/TaskGroupsContent.tsx
+++ b/packages/twenty-front/src/modules/activities/tasks/components/TaskGroupsContent.tsx
@@ -5,13 +5,13 @@ import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadata
import { AnimatedPlaceholder } from '@/ui/feedback/empty-state/components/AnimatedPlaceholder/AnimatedPlaceholder';
import { EmptyState } from '@/ui/feedback/empty-state/components/EmptyState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import groupBy from 'lodash.groupby';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconPlus } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: flex;
@@ -30,6 +30,7 @@ export const TaskGroupsContent = ({
onCreateTask,
tasks,
}: TaskGroupsContentProps) => {
+ const { t } = useLingui();
const { objectMetadataItem: taskObjectMetadataItem } = useObjectMetadataItem({
objectNameSingular: CoreObjectNameSingular.Task,
});
diff --git a/packages/twenty-front/src/modules/activities/tasks/components/TaskRow.tsx b/packages/twenty-front/src/modules/activities/tasks/components/TaskRow.tsx
index effbe4bbab8..975064f6a10 100644
--- a/packages/twenty-front/src/modules/activities/tasks/components/TaskRow.tsx
+++ b/packages/twenty-front/src/modules/activities/tasks/components/TaskRow.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { LinkifiedText } from '@/ui/field/display/components/LinkifiedText/LinkifiedText';
@@ -23,6 +22,7 @@ import { IconCalendar } from 'twenty-ui/icon';
import { Checkbox } from 'twenty-ui/primitives/input';
import { Card } from 'twenty-ui/primitives/surfaces';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledTaskBody = styled.div`
color: ${themeCssVariables.font.color.tertiary};
@@ -96,6 +96,7 @@ export const TaskRow = ({
task: Task;
divider?: boolean;
}) => {
+ const { t } = useLingui();
const theme = useTheme();
const { openRecordInSidePanel } = useOpenRecordInSidePanel();
diff --git a/packages/twenty-front/src/modules/activities/timeline-activities/components/TimelineCard.tsx b/packages/twenty-front/src/modules/activities/timeline-activities/components/TimelineCard.tsx
index 13cadce0794..9b35706f37e 100644
--- a/packages/twenty-front/src/modules/activities/timeline-activities/components/TimelineCard.tsx
+++ b/packages/twenty-front/src/modules/activities/timeline-activities/components/TimelineCard.tsx
@@ -10,8 +10,8 @@ import { AnimatedPlaceholder } from '@/ui/feedback/empty-state/components/Animat
import { StyledWidgetScrollContainer } from '@/ui/layout/components/WidgetContentContainer';
import { useTargetRecord } from '@/ui/layout/contexts/useTargetRecord';
import { useWorkspaceSurface } from '@/ui/layout/hooks/useWorkspaceSurface';
-import { t } from '@lingui/core/macro';
import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledMainContainer = styled(StyledWidgetScrollContainer)`
align-items: flex-start;
@@ -32,6 +32,7 @@ const StyledSidePanelPlaceholderWrapper = styled.div`
`;
export const TimelineCard = () => {
+ const { t } = useLingui();
const targetRecord = useTargetRecord();
const isInSidePanel = useWorkspaceSurface().type === 'side-panel';
const {
diff --git a/packages/twenty-front/src/modules/activities/timeline-activities/rows/calendar/components/EventCardCalendarEvent.tsx b/packages/twenty-front/src/modules/activities/timeline-activities/rows/calendar/components/EventCardCalendarEvent.tsx
index c13ff964757..ba5c0a8fe9a 100644
--- a/packages/twenty-front/src/modules/activities/timeline-activities/rows/calendar/components/EventCardCalendarEvent.tsx
+++ b/packages/twenty-front/src/modules/activities/timeline-activities/rows/calendar/components/EventCardCalendarEvent.tsx
@@ -1,6 +1,5 @@
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import {
@@ -21,6 +20,7 @@ import {
formatToHumanReadableMonth,
formatToHumanReadableTime,
} from '~/utils/format/formatDate';
+import { useLingui } from '@lingui/react/macro';
const StyledEventCardCalendarEventContainer = styled.div`
cursor: pointer;
@@ -93,6 +93,7 @@ export const EventCardCalendarEvent = ({
}: {
calendarEventId: string;
}) => {
+ const { t } = useLingui();
const { openCalendarEventInSidePanel } = useOpenCalendarEventInSidePanel();
const { timeZone } = useContext(UserContext);
diff --git a/packages/twenty-front/src/modules/activities/timeline-activities/rows/generic/components/EventRowGenericLinked.tsx b/packages/twenty-front/src/modules/activities/timeline-activities/rows/generic/components/EventRowGenericLinked.tsx
index 11293eb2802..f05dfc5e5aa 100644
--- a/packages/twenty-front/src/modules/activities/timeline-activities/rows/generic/components/EventRowGenericLinked.tsx
+++ b/packages/twenty-front/src/modules/activities/timeline-activities/rows/generic/components/EventRowGenericLinked.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { type KeyboardEvent, useState } from 'react';
import { EventCard } from '@/activities/timeline-activities/rows/components/EventCard';
@@ -21,6 +20,7 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
+import { useLingui } from '@lingui/react/macro';
type EventRowGenericLinkedProps = EventRowNativeComponentProps;
@@ -32,6 +32,7 @@ export const EventRowGenericLinked = ({
happensAt,
hasRenderer,
}: EventRowGenericLinkedProps) => {
+ const { t } = useLingui();
const { openRecordInSidePanel } = useOpenRecordInSidePanel();
const [isOpen, setIsOpen] = useState(false);
diff --git a/packages/twenty-front/src/modules/activities/timeline-activities/rows/main-object/components/EventRowMainObject.tsx b/packages/twenty-front/src/modules/activities/timeline-activities/rows/main-object/components/EventRowMainObject.tsx
index ab96fcc45be..52598dcafbe 100644
--- a/packages/twenty-front/src/modules/activities/timeline-activities/rows/main-object/components/EventRowMainObject.tsx
+++ b/packages/twenty-front/src/modules/activities/timeline-activities/rows/main-object/components/EventRowMainObject.tsx
@@ -7,8 +7,8 @@ import {
StyledEventRowContent,
} from '@/activities/timeline-activities/rows/components/EventRowStyles';
import { EventRowMainObjectUpdated } from '@/activities/timeline-activities/rows/main-object/components/EventRowMainObjectUpdated';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
type EventRowMainObjectProps = EventRowNativeComponentProps;
@@ -22,6 +22,7 @@ export const EventRowMainObject = ({
happensAt,
hasRenderer,
}: EventRowMainObjectProps) => {
+ const { t } = useLingui();
switch (eventAction) {
case 'created': {
return (
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/ImageBubbleMenu.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/ImageBubbleMenu.tsx
index 64d576a0dfb..f6fa7e54eda 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/components/ImageBubbleMenu.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/components/ImageBubbleMenu.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { BubbleMenuIconButton } from '@/advanced-text-editor/components/BubbleMenuIconButton';
import { BubbleMenuSeparator } from '@/advanced-text-editor/components/BubbleMenuSeparator';
import { StyledBubbleMenuContainer } from '@/advanced-text-editor/components/StyledBubbleMenuContainer';
@@ -11,12 +10,14 @@ import {
IconAlignRight,
IconTrash,
} from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type ImageBubbleMenuProps = {
editor: Editor;
};
export const ImageBubbleMenu = ({ editor }: ImageBubbleMenuProps) => {
+ const { t } = useLingui();
const state = useLiveEditorState(editor, (currentEditor) => {
return {
align: currentEditor.getAttributes('image').align || 'left',
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/LinkBubbleMenu.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/LinkBubbleMenu.tsx
index df42d695ef3..62342f7b022 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/components/LinkBubbleMenu.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/components/LinkBubbleMenu.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { BubbleMenuIconButton } from '@/advanced-text-editor/components/BubbleMenuIconButton';
import { EditLinkDropdown } from '@/advanced-text-editor/components/EditLinkDropdown';
import { StyledBubbleMenuContainer } from '@/advanced-text-editor/components/StyledBubbleMenuContainer';
@@ -9,12 +8,14 @@ import { BubbleMenu } from '@tiptap/react/menus';
import { IconExternalLink, IconLinkOff } from 'twenty-ui/icon';
import { getSafeUrl } from 'twenty-shared/utils';
import { openUrlInNewTab } from '~/utils/openUrlInNewTab';
+import { useLingui } from '@lingui/react/macro';
type LinkBubbleMenuProps = {
editor: Editor;
};
export const LinkBubbleMenu = ({ editor }: LinkBubbleMenuProps) => {
+ const { t } = useLingui();
const state = useLiveEditorState(editor, (currentEditor) => {
return {
linkHref: currentEditor.getAttributes('link').href || '',
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/TextBubbleMenu.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/TextBubbleMenu.tsx
index ed5e4ef82a2..14df60099ec 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/components/TextBubbleMenu.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/components/TextBubbleMenu.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { isNonEmptyArray } from '@sniptt/guards';
import { Fragment, type ReactNode } from 'react';
import { StyledBubbleMenuContainer } from '@/advanced-text-editor/components/StyledBubbleMenuContainer';
@@ -26,12 +25,14 @@ import {
IconStrikethrough,
IconUnderline,
} from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type TextBubbleMenuProps = {
editor: Editor;
};
export const TextBubbleMenu = ({ editor }: TextBubbleMenuProps) => {
+ const { t } = useLingui();
const state = useTextBubbleState(editor);
const menuActions = [
{
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/TurnIntoBlockDropdown.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/TurnIntoBlockDropdown.tsx
index fedabf23f2a..d9450d8a1b7 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/components/TurnIntoBlockDropdown.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/components/TurnIntoBlockDropdown.tsx
@@ -3,12 +3,12 @@ import { useTurnIntoBlockOptions } from '@/advanced-text-editor/hooks/useTurnInt
import { Dropdown } from 'twenty-ui/components/navigation';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
-import { t } from '@lingui/core/macro';
import { type Editor } from '@tiptap/react';
import { useId } from 'react';
import { LightButton } from 'twenty-ui/components/input';
import { IconTextSize } from 'twenty-ui/icon';
import { useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type TurnIntoBlockDropdownProps = {
editor: Editor;
@@ -17,6 +17,7 @@ type TurnIntoBlockDropdownProps = {
export const TurnIntoBlockDropdown = ({
editor,
}: TurnIntoBlockDropdownProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const instanceId = useId();
const dropdownId = `turn-into-block-dropdown-${instanceId}`;
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/extensions/blocks/HtmlNodeInlineEditor.tsx b/packages/twenty-front/src/modules/advanced-text-editor/extensions/blocks/HtmlNodeInlineEditor.tsx
index 896047a7f5a..0f0fdb4b6cc 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/extensions/blocks/HtmlNodeInlineEditor.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/extensions/blocks/HtmlNodeInlineEditor.tsx
@@ -1,11 +1,11 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { EditorContent, type Editor } from '@tiptap/react';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
import { useTextVariableEditor } from '@/object-record/record-field/ui/form-types/hooks/useTextVariableEditor';
import { FORM_FIELD_PLACEHOLDER_STYLES } from '@/ui/input/constants/FormFieldPlaceholderStyles';
+import { useLingui } from '@lingui/react/macro';
type HtmlNodeInlineEditorProps = {
html: string;
@@ -41,6 +41,7 @@ export const HtmlNodeInlineEditor = ({
onChange,
onFocus,
}: HtmlNodeInlineEditorProps) => {
+ const { t } = useLingui();
const htmlEditor = useTextVariableEditor({
placeholder: t`Paste or write your HTML here`,
multiline: true,
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/extensions/file/FileNodeView.tsx b/packages/twenty-front/src/modules/advanced-text-editor/extensions/file/FileNodeView.tsx
index bafac8cb95c..2a972a11dd0 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/extensions/file/FileNodeView.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/extensions/file/FileNodeView.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type NodeViewProps, NodeViewWrapper } from '@tiptap/react';
import { type ChangeEvent, useRef } from 'react';
import { getSafeUrl, isDefined, TIPTAP_NODE_TYPES } from 'twenty-shared/utils';
@@ -9,6 +8,7 @@ import { themeCssVariables } from 'twenty-ui/theme';
import { getFileType } from '@/activities/files/utils/getFileType';
import { isImageFile } from '@/advanced-text-editor/utils/isImageFile';
import { FileIcon } from '@/file/components/FileIcon';
+import { useLingui } from '@lingui/react/macro';
const StyledFileLine = styled.div`
align-items: center;
@@ -43,6 +43,7 @@ export const FileNodeView = ({
getPos,
updateAttributes,
}: FileNodeViewProps) => {
+ const { t } = useLingui();
// oxlint-disable-next-line twenty/no-state-useref
const fileInputRef = useRef<HTMLInputElement>(null);
const { onFileUpload, onFileUploadError } = editor.extensionStorage.upload;
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/extensions/variable-tag/VariableChip.tsx b/packages/twenty-front/src/modules/advanced-text-editor/extensions/variable-tag/VariableChip.tsx
index f2ce5aecfe1..1bb6cea9a6d 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/extensions/variable-tag/VariableChip.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/extensions/variable-tag/VariableChip.tsx
@@ -1,8 +1,8 @@
import { BaseChip } from '@/ui/input/components/BaseChip';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { NodeViewWrapper, type NodeViewProps } from '@tiptap/react';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledWrapper = styled.span`
display: inline-block;
@@ -19,13 +19,16 @@ export const VariableChip = ({
editor,
label,
title,
-}: VariableChipProps) => (
- <NodeViewWrapper as={StyledWrapper} style={{ whiteSpace: 'nowrap' }}>
- <BaseChip
- label={label}
- title={title}
- onRemove={editor.isEditable ? deleteNode : undefined}
- removeAriaLabel={t`Remove variable`}
- />
- </NodeViewWrapper>
-);
+}: VariableChipProps) => {
+ const { t } = useLingui();
+ return (
+ <NodeViewWrapper as={StyledWrapper} style={{ whiteSpace: 'nowrap' }}>
+ <BaseChip
+ label={label}
+ title={title}
+ onRemove={editor.isEditable ? deleteNode : undefined}
+ removeAriaLabel={t`Remove variable`}
+ />
+ </NodeViewWrapper>
+ );
+};
diff --git a/packages/twenty-front/src/modules/ai/components/AgentOutputFieldTypeSelector.tsx b/packages/twenty-front/src/modules/ai/components/AgentOutputFieldTypeSelector.tsx
index 3f462a30574..ca0a2bc712b 100644
--- a/packages/twenty-front/src/modules/ai/components/AgentOutputFieldTypeSelector.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AgentOutputFieldTypeSelector.tsx
@@ -1,7 +1,7 @@
import { OUTPUT_FIELD_TYPE_OPTIONS } from '@/ai/constants/OutputFieldTypeOptions';
import { Select } from '@/ui/input/components/Select';
-import { t } from '@lingui/core/macro';
import { type AgentResponseFieldType } from 'twenty-shared/ai';
+import { useLingui } from '@lingui/react/macro';
type AgentOutputFieldTypeSelectorProps = {
value?: AgentResponseFieldType;
@@ -16,6 +16,7 @@ export const AgentOutputFieldTypeSelector = ({
disabled,
dropdownId,
}: AgentOutputFieldTypeSelectorProps) => {
+ const { t } = useLingui();
return (
<Select
dropdownId={dropdownId}
diff --git a/packages/twenty-front/src/modules/ai/components/AgentOutputSchemaBuilder.tsx b/packages/twenty-front/src/modules/ai/components/AgentOutputSchemaBuilder.tsx
index 65a22e80650..6b2c970378a 100644
--- a/packages/twenty-front/src/modules/ai/components/AgentOutputSchemaBuilder.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AgentOutputSchemaBuilder.tsx
@@ -4,7 +4,6 @@ import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/c
import { FormFieldInputContainer } from '@/ui/input/components/FormFieldInputContainer';
import { InputLabel } from '@/ui/input/components/internal/InputLabel/InputLabel';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useState } from 'react';
import { isValidAgentResponseSchemaPropertyKey } from 'twenty-shared/ai';
@@ -14,6 +13,8 @@ import { ListItemButton } from 'twenty-ui/components/navigation';
import { themeCssVariables } from 'twenty-ui/theme';
import { AgentOutputFieldTypeSelector } from '@/ai/components/AgentOutputFieldTypeSelector';
import { AgentOutputSchemaFieldHeader } from '@/ai/components/AgentOutputSchemaFieldHeader';
+import { useLingui } from '@lingui/react/macro';
+
type AgentOutputSchemaBuilderProps = {
fields: OutputSchemaField[];
onChange: (fields: OutputSchemaField[]) => void;
@@ -72,6 +73,7 @@ export const AgentOutputSchemaBuilder = ({
onChange,
readonly,
}: AgentOutputSchemaBuilderProps) => {
+ const { t } = useLingui();
const [expandedFieldIds, setExpandedFieldIds] = useState<Set<string>>(
() => new Set(fields.map((field) => field.id)),
);
diff --git a/packages/twenty-front/src/modules/ai/components/AgentOutputSchemaFieldHeader.tsx b/packages/twenty-front/src/modules/ai/components/AgentOutputSchemaFieldHeader.tsx
index 78a6cb271da..7346cc87196 100644
--- a/packages/twenty-front/src/modules/ai/components/AgentOutputSchemaFieldHeader.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AgentOutputSchemaFieldHeader.tsx
@@ -1,10 +1,10 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconChevronDown, IconVariable, IconX } from 'twenty-ui/icon';
import { themeCssVariables, useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type AgentOutputSchemaFieldHeaderProps = {
name: string;
@@ -90,6 +90,7 @@ export const AgentOutputSchemaFieldHeader = ({
onToggle,
onRemove,
}: AgentOutputSchemaFieldHeaderProps) => {
+ const { t } = useLingui();
const theme = useTheme();
return (
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatApiKeyNotConfiguredMessage.tsx b/packages/twenty-front/src/modules/ai/components/AiChatApiKeyNotConfiguredMessage.tsx
index 77afd97c1b4..23429b11d67 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatApiKeyNotConfiguredMessage.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatApiKeyNotConfiguredMessage.tsx
@@ -3,12 +3,13 @@ import { AiChatInlineBanner } from '@/ai/components/AiChatInlineBanner';
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { getDocumentationUrl } from '@/support/utils/getDocumentationUrl';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { DOCUMENTATION_PATHS } from 'twenty-shared/constants';
import { IconExternalLink } from 'twenty-ui/icon';
import { openUrlInNewTab } from '~/utils/openUrlInNewTab';
+import { useLingui } from '@lingui/react/macro';
export const AiChatApiKeyNotConfiguredMessage = () => {
+ const { t } = useLingui();
const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
const handleDocsClick = () => {
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatErrorMessage.tsx b/packages/twenty-front/src/modules/ai/components/AiChatErrorMessage.tsx
index 0c20c11bd84..6147184874b 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatErrorMessage.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatErrorMessage.tsx
@@ -1,6 +1,5 @@
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { IconAlertCircle, IconRefresh } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
@@ -9,6 +8,7 @@ import { isDefined } from 'twenty-shared/utils';
import { type AiChatError } from '@/ai/types/AiChatError';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { getErrorMessageFromApolloError } from '~/utils/get-error-message-from-apollo-error.util';
+import { useLingui } from '@lingui/react/macro';
const StyledErrorContainer = styled.div`
align-items: center;
@@ -58,6 +58,7 @@ export const AiChatErrorMessage = ({
onRetry,
action,
}: AiChatErrorMessageProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const errorMessage = CombinedGraphQLErrors.is(error)
? getErrorMessageFromApolloError(error)
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatScrollToBottomButton.tsx b/packages/twenty-front/src/modules/ai/components/AiChatScrollToBottomButton.tsx
index a715d3b429b..d2b416b9f74 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatScrollToBottomButton.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatScrollToBottomButton.tsx
@@ -3,11 +3,12 @@ import { scrollAiChatToBottom } from '@/ai/utils/scrollAiChatToBottom';
import { ScrollOverlayButton } from '@/ui/utilities/scroll/components/ScrollOverlayButton';
import { useScrollWrapperHTMLElement } from '@/ui/utilities/scroll/hooks/useScrollWrapperHTMLElement';
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconArrowDown } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const AiChatScrollToBottomButton = () => {
+ const { t } = useLingui();
const agentChatIsScrolledToBottom = useAtomComponentSelectorValue(
agentChatIsScrolledToBottomComponentSelector,
);
diff --git a/packages/twenty-front/src/modules/ai/components/SettingsAgentModelCapabilities.tsx b/packages/twenty-front/src/modules/ai/components/SettingsAgentModelCapabilities.tsx
index 22c6a7615c5..75da8f4232e 100644
--- a/packages/twenty-front/src/modules/ai/components/SettingsAgentModelCapabilities.tsx
+++ b/packages/twenty-front/src/modules/ai/components/SettingsAgentModelCapabilities.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import {
type ModelConfiguration,
parseAiModelVariantId,
@@ -9,6 +8,7 @@ import { IconBrandX, IconWorld } from 'twenty-ui/icon';
import { useResolvedAiModel } from '@/ai/hooks/useResolvedAiModel';
import { InputLabel } from '@/ui/input/components/internal/InputLabel/InputLabel';
+import { useLingui } from '@lingui/react/macro';
type SettingsAgentModelCapabilitiesProps = {
selectedModelId: string;
@@ -23,6 +23,7 @@ export const SettingsAgentModelCapabilities = ({
onConfigurationChange,
disabled = false,
}: SettingsAgentModelCapabilitiesProps) => {
+ const { t } = useLingui();
const { modelId: baseModelId } = parseAiModelVariantId(selectedModelId);
const selectedModel = useResolvedAiModel(baseModelId);
diff --git a/packages/twenty-front/src/modules/ai/components/ThinkingStepsDisplay.tsx b/packages/twenty-front/src/modules/ai/components/ThinkingStepsDisplay.tsx
index 288c2ae511b..0a0d21369de 100644
--- a/packages/twenty-front/src/modules/ai/components/ThinkingStepsDisplay.tsx
+++ b/packages/twenty-front/src/modules/ai/components/ThinkingStepsDisplay.tsx
@@ -1,5 +1,5 @@
import { styled } from '@linaria/react';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { useState } from 'react';
import { Collapsible } from 'twenty-ui/primitives/layout';
import { IconChevronRight, ThinkingOrbitLoaderIcon } from 'twenty-ui/icon';
@@ -14,6 +14,7 @@ import { getThinkingStepLabel } from '@/ai/utils/getThinkingStepLabel';
import { isThinkingStepPartActive } from '@/ai/utils/isThinkingStepPartActive';
import { type ThinkingStepPart } from '@/ai/types/ThinkingStepPart';
import { formatRoundedDuration } from '~/utils/format/formatRoundedDuration';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: flex;
@@ -135,6 +136,7 @@ export const ThinkingStepsDisplay = ({
isTrailingWhileStreaming?: boolean;
workDurationMs?: number | null;
}) => {
+ const { t } = useLingui();
const [isExpanded, setIsExpanded] = useState(false);
const displayContext = useToolDisplayContext();
diff --git a/packages/twenty-front/src/modules/ai/components/ThinkingToolStepRow.tsx b/packages/twenty-front/src/modules/ai/components/ThinkingToolStepRow.tsx
index 1ebd8bbdc1f..4b24c11e564 100644
--- a/packages/twenty-front/src/modules/ai/components/ThinkingToolStepRow.tsx
+++ b/packages/twenty-front/src/modules/ai/components/ThinkingToolStepRow.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { getToolName, type DynamicToolUIPart, type ToolUIPart } from 'ai';
import { isDefined, isNonEmptyArray, isPlainObject } from 'twenty-shared/utils';
@@ -20,6 +19,7 @@ import { TabListRoot } from '@/ui/layout/tab-list/components/TabListRoot';
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
+import { useLingui } from '@lingui/react/macro';
const StyledToolDetailsContainer = styled.div`
background: ${themeCssVariables.background.transparent.lighter};
@@ -71,6 +71,7 @@ export const ThinkingToolStepRow = ({
isActive,
part,
}: ThinkingToolStepRowProps) => {
+ const { t } = useLingui();
const { copyToClipboard } = useCopyToClipboard();
const rawToolName = getToolName(part);
const { toolInput, toolName } = unwrapToolInput({
diff --git a/packages/twenty-front/src/modules/ai/components/internal/AgentChatFilePreview.tsx b/packages/twenty-front/src/modules/ai/components/internal/AgentChatFilePreview.tsx
index 509de3abb1c..16987defb8c 100644
--- a/packages/twenty-front/src/modules/ai/components/internal/AgentChatFilePreview.tsx
+++ b/packages/twenty-front/src/modules/ai/components/internal/AgentChatFilePreview.tsx
@@ -8,7 +8,6 @@ import { AvatarOrIcon } from '@/ui/field/display/components/internal/AvatarOrIco
import { filePreviewState } from '@/ui/field/display/states/filePreviewState';
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useCallback } from 'react';
import { type ExtendedFileUIPart } from 'twenty-shared/ai';
import { isDefined } from 'twenty-shared/utils';
@@ -17,6 +16,7 @@ import { Chip } from 'twenty-ui/primitives/data-display';
import { Loader } from 'twenty-ui/primitives/feedback';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { themeCssVariables, useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledPreviewButton = styled.button`
align-items: center;
@@ -52,6 +52,7 @@ export const AgentChatFilePreview = ({
onRemove?: () => void;
isUploading?: boolean;
}) => {
+ const { t } = useLingui();
const theme = useTheme();
const iconColors: Record<AttachmentFileCategory, string> =
useFileCategoryColors();
diff --git a/packages/twenty-front/src/modules/ai/components/internal/SendMessageButton.tsx b/packages/twenty-front/src/modules/ai/components/internal/SendMessageButton.tsx
index 069511d6fd5..f003c9e01e1 100644
--- a/packages/twenty-front/src/modules/ai/components/internal/SendMessageButton.tsx
+++ b/packages/twenty-front/src/modules/ai/components/internal/SendMessageButton.tsx
@@ -7,10 +7,10 @@ import { currentAiChatThreadState } from '@/ai/states/currentAiChatThreadState';
import { agentChatInputIsEmptySelector } from '@/ai/states/selectors/agentChatInputIsEmptySelector';
import { dispatchBrowserEvent } from '@/browser-event/utils/dispatchBrowserEvent';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { IconButton } from 'twenty-ui/components/input';
import { IconArrowUp, IconPlayerStop } from 'twenty-ui/icon';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
+import { useLingui } from '@lingui/react/macro';
type SendMessageButtonProps = {
isDisabled?: boolean;
@@ -19,6 +19,7 @@ type SendMessageButtonProps = {
export const SendMessageButton = ({
isDisabled = false,
}: SendMessageButtonProps) => {
+ const { t } = useLingui();
const agentChatInputIsEmpty = useAtomStateValue(
agentChatInputIsEmptySelector,
);
diff --git a/packages/twenty-front/src/modules/ai/components/suggested-prompts/AiChatSuggestedPrompts.tsx b/packages/twenty-front/src/modules/ai/components/suggested-prompts/AiChatSuggestedPrompts.tsx
index 1322c3009ce..a4f3014a6fc 100644
--- a/packages/twenty-front/src/modules/ai/components/suggested-prompts/AiChatSuggestedPrompts.tsx
+++ b/packages/twenty-front/src/modules/ai/components/suggested-prompts/AiChatSuggestedPrompts.tsx
@@ -1,6 +1,5 @@
import { isDefined } from 'twenty-shared/utils';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useLingui } from '@lingui/react/macro';
import { LightButton } from 'twenty-ui/components/input';
import { Button } from 'twenty-ui/primitives/input';
@@ -64,6 +63,7 @@ type AiChatSuggestedPromptsProps = {
export const AiChatSuggestedPrompts = ({
isCentered = false,
}: AiChatSuggestedPromptsProps) => {
+ const { t } = useLingui();
const { t: resolveMessage } = useLingui();
const { stageAiChatPreprompt } = useStageAiChatPreprompt();
const aiChatSuggestedPromptsContext = useAiChatSuggestedPromptsContext();
diff --git a/packages/twenty-front/src/modules/ai/dictation/components/AiChatDictationButton.tsx b/packages/twenty-front/src/modules/ai/dictation/components/AiChatDictationButton.tsx
index 7ea7864b49e..f10cf839bf0 100644
--- a/packages/twenty-front/src/modules/ai/dictation/components/AiChatDictationButton.tsx
+++ b/packages/twenty-front/src/modules/ai/dictation/components/AiChatDictationButton.tsx
@@ -1,10 +1,11 @@
-import { t } from '@lingui/core/macro';
import { IconMicrophone } from 'twenty-ui/icon';
import { IconButton } from 'twenty-ui/components/input';
import { useDictation } from '@/ai/dictation/hooks/useDictation';
+import { useLingui } from '@lingui/react/macro';
export const AiChatDictationButton = () => {
+ const { t } = useLingui();
const { isAvailable, isRecording, toggleDictation } = useDictation();
if (!isAvailable) {
diff --git a/packages/twenty-front/src/modules/ai/hooks/useAiChatEditor.ts b/packages/twenty-front/src/modules/ai/hooks/useAiChatEditor.ts
index a82332acf82..f928cf27e7f 100644
--- a/packages/twenty-front/src/modules/ai/hooks/useAiChatEditor.ts
+++ b/packages/twenty-front/src/modules/ai/hooks/useAiChatEditor.ts
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { useCallback } from 'react';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
@@ -30,8 +29,10 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
import { turnIntoEmptyStringIfWhitespacesOnly } from '~/utils/string/turnIntoEmptyStringIfWhitespacesOnly';
+import { useLingui } from '@lingui/react/macro';
export const useAiChatEditor = () => {
+ const { t } = useLingui();
const currentAiChatThread = useAtomStateValue(currentAiChatThreadState);
const aiModels = useAtomStateValue(aiModelsState);
const newAiChatThreadId = useAtomStateValue(newAiChatThreadIdState);
diff --git a/packages/twenty-front/src/modules/app/components/RootAppProviders.tsx b/packages/twenty-front/src/modules/app/components/RootAppProviders.tsx
index bfa793da571..1dfde933b90 100644
--- a/packages/twenty-front/src/modules/app/components/RootAppProviders.tsx
+++ b/packages/twenty-front/src/modules/app/components/RootAppProviders.tsx
@@ -1,4 +1,5 @@
import { StrictMode } from 'react';
+import { useLingui } from '@lingui/react';
import { Outlet, useLocation } from 'react-router-dom';
import { TrackPageViewEffect } from '@/analytics/components/TrackPageViewEffect';
@@ -21,6 +22,8 @@ import { getPageTitleFromPath } from '~/utils/title-utils';
export const RootAppProviders = () => {
const { pathname } = useLocation();
+ // getPageTitleFromPath reads the global i18n, so subscribe to re-render on locale change
+ useLingui();
const pageTitle = getPageTitleFromPath(pathname);
return (
diff --git a/packages/twenty-front/src/modules/app/components/WorkspaceAppPageTitle.tsx b/packages/twenty-front/src/modules/app/components/WorkspaceAppPageTitle.tsx
index 3c52980ca4f..97296d7da40 100644
--- a/packages/twenty-front/src/modules/app/components/WorkspaceAppPageTitle.tsx
+++ b/packages/twenty-front/src/modules/app/components/WorkspaceAppPageTitle.tsx
@@ -1,3 +1,4 @@
+import { useLingui } from '@lingui/react';
import { useLocation } from 'react-router-dom';
import { PageTitle } from '@/ui/utilities/page-title/components/PageTitle';
@@ -5,6 +6,8 @@ import { getPageTitleFromPath } from '~/utils/title-utils';
export const WorkspaceAppPageTitle = () => {
const { pathname } = useLocation();
+ // getPageTitleFromPath reads the global i18n, so subscribe to re-render on locale change
+ useLingui();
return <PageTitle title={getPageTitleFromPath(pathname)} />;
};
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/EmailVerificationSent.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/EmailVerificationSent.tsx
index 2bc830fc56c..036a0d02a57 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/EmailVerificationSent.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/EmailVerificationSent.tsx
@@ -11,11 +11,11 @@ import {
} from '@/auth/states/signInUpStepState';
import { OnboardingModalCircularIcon } from '@/onboarding/components/OnboardingModalCircularIcon';
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
-import { t } from '@lingui/core/macro';
import { MainButton } from 'twenty-ui/components/input';
import { IconGmail, IconMail, IconMailX, IconMicrosoft } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
import { openUrlInNewTab } from '~/utils/openUrlInNewTab';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
align-items: center;
@@ -68,6 +68,7 @@ export const EmailVerificationSent = ({
email: string | null;
isError?: boolean;
}) => {
+ const { t } = useLingui();
const setSignInUpStep = useSetAtomState(signInUpStepState);
const { handleResendEmailVerificationToken, loading: isLoading } =
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useUploadNewWorkspaceLogo.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useUploadNewWorkspaceLogo.ts
index fabdc259248..7a247414eb9 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useUploadNewWorkspaceLogo.ts
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useUploadNewWorkspaceLogo.ts
@@ -1,5 +1,4 @@
import { putFileToUploadTarget } from '@/file/utils/putFileToUploadTarget';
-import { t } from '@lingui/core/macro';
import { useMutation } from '@apollo/client/react';
import { isDefined } from 'twenty-shared/utils';
import {
@@ -7,8 +6,10 @@ import {
CreateNewWorkspaceLogoUploadDocument,
type FileWithSignedUrl,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useUploadNewWorkspaceLogo = () => {
+ const { t } = useLingui();
const [createNewWorkspaceLogoUpload] = useMutation(
CreateNewWorkspaceLogoUploadDocument,
);
diff --git a/packages/twenty-front/src/modules/command-menu-item/display/components/CommandMenuItemSectionGroup.tsx b/packages/twenty-front/src/modules/command-menu-item/display/components/CommandMenuItemSectionGroup.tsx
index 4cd12ad2191..cc839dfa8fa 100644
--- a/packages/twenty-front/src/modules/command-menu-item/display/components/CommandMenuItemSectionGroup.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/display/components/CommandMenuItemSectionGroup.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import React, { type ReactNode } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { type IconComponent } from 'twenty-ui/icon';
@@ -7,6 +6,7 @@ import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { themeCssVariables, useTheme } from 'twenty-ui/theme';
import { type CommandMenuItemSectionContext } from '@/command-menu-item/types/CommandMenuItemSectionContext';
+import { useLingui } from '@lingui/react/macro';
const StyledSection = styled.div`
display: flex;
@@ -70,6 +70,7 @@ export const CommandMenuItemSectionGroup = ({
context,
children,
}: CommandMenuItemSectionGroupProps) => {
+ const { t } = useLingui();
const theme = useTheme();
if (!isDefined(children) || !React.Children.count(children)) {
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/components/HeadlessOpenSidePanelPageEngineCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/components/HeadlessOpenSidePanelPageEngineCommand.tsx
index ba810364112..80329dda34c 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/components/HeadlessOpenSidePanelPageEngineCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/components/HeadlessOpenSidePanelPageEngineCommand.tsx
@@ -4,8 +4,8 @@ import { sidePanelSearchState } from '@/side-panel/states/sidePanelSearchState';
import { type NonPageLayoutPurposeBuiltSidePanelPage } from '@/side-panel/types/SidePanelPage';
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { type MessageDescriptor } from '@lingui/core';
-import { t } from '@lingui/core/macro';
import { type IconComponent } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const HeadlessOpenSidePanelPageEngineCommand = ({
page,
@@ -18,6 +18,7 @@ export const HeadlessOpenSidePanelPageEngineCommand = ({
pageIcon: IconComponent;
shouldResetSearchState?: boolean;
}) => {
+ const { t } = useLingui();
const { navigateSidePanel } = useNavigateSidePanel();
const setSidePanelSearch = useSetAtomState(sidePanelSearchState);
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/DeleteRecordsCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/DeleteRecordsCommand.tsx
index be1cb09cf13..23c994d874f 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/DeleteRecordsCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/DeleteRecordsCommand.tsx
@@ -1,5 +1,4 @@
import { DeleteCoreWorkflowsCommand } from '@/object-core/workflows/components/DeleteCoreWorkflowsCommand';
-import { t } from '@lingui/core/macro';
import {
CoreObjectNameSingular,
type RecordGqlOperationFilter,
@@ -16,8 +15,10 @@ import { useResetRecordSelection } from '@/object-record/record-selection/hooks/
import { useSidePanelMenu } from '@/side-panel/hooks/useSidePanelMenu';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
const DeleteWorkspaceRecordsCommand = () => {
+ const { t } = useLingui();
const { recordIndexId, objectMetadataItem, selectedRecords, graphqlFilter } =
useHeadlessCommandContextApi();
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/DestroyRecordsCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/DestroyRecordsCommand.tsx
index b2c628d24d2..ae9775f05de 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/DestroyRecordsCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/DestroyRecordsCommand.tsx
@@ -6,7 +6,6 @@ import { useRemoveSelectedRecordsFromRecordBoard } from '@/object-record/record-
import { PLACEHOLDER_RECORD_INDEX_ID } from '@/object-record/record-index/constants/PlaceholderRecordIndexId';
import { useResetRecordSelection } from '@/object-record/record-selection/hooks/useResetRecordSelection';
import { useSidePanelMenu } from '@/side-panel/hooks/useSidePanelMenu';
-import { t } from '@lingui/core/macro';
import {
AppPath,
CoreObjectNameSingular,
@@ -15,8 +14,10 @@ import {
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
import { useNavigateApp } from '~/hooks/useNavigateApp';
+import { useLingui } from '@lingui/react/macro';
export const DestroyRecordsCommand = () => {
+ const { t } = useLingui();
const {
recordIndexId,
objectMetadataItem,
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/RestoreRecordsCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/RestoreRecordsCommand.tsx
index 374e8932f3e..44aa76bea55 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/RestoreRecordsCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/RestoreRecordsCommand.tsx
@@ -7,12 +7,13 @@ import { useRemoveSelectedRecordsFromRecordBoard } from '@/object-record/record-
import { PLACEHOLDER_RECORD_INDEX_ID } from '@/object-record/record-index/constants/PlaceholderRecordIndexId';
import { useResetRecordSelection } from '@/object-record/record-selection/hooks/useResetRecordSelection';
import { useSidePanelMenu } from '@/side-panel/hooks/useSidePanelMenu';
-import { t } from '@lingui/core/macro';
import { type RecordGqlOperationFilter } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
export const RestoreRecordsCommand = () => {
+ const { t } = useLingui();
const { recordIndexId, objectMetadataItem, selectedRecords, graphqlFilter } =
useHeadlessCommandContextApi();
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-campaign/components/CancelMessageCampaignSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-campaign/components/CancelMessageCampaignSingleRecordCommand.tsx
index 0ae3353593d..33e856d258f 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-campaign/components/CancelMessageCampaignSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-campaign/components/CancelMessageCampaignSingleRecordCommand.tsx
@@ -5,9 +5,10 @@ import { doNotTranslate } from 'twenty-shared/i18n';
import { useCancelMessageCampaign } from '@/activities/emails/hooks/useCancelMessageCampaign';
import { HeadlessConfirmationModalEngineCommandEffect } from '@/command-menu-item/engine-command/components/HeadlessConfirmationModalEngineCommandEffect';
import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
export const CancelMessageCampaignSingleRecordCommand = () => {
+ const { t } = useLingui();
const { selectedRecords } = useHeadlessCommandContextApi();
const selectedRecord = selectedRecords[0];
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-list/hooks/useDuplicateMessageList.ts b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-list/hooks/useDuplicateMessageList.ts
index 9207d3505de..2977df65ad0 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-list/hooks/useDuplicateMessageList.ts
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-list/hooks/useDuplicateMessageList.ts
@@ -2,13 +2,14 @@ import { useMetadataErrorHandler } from '@/metadata-error-handler/hooks/useMetad
import { useAddDuplicatedRecordToCache } from '@/object-record/cache/hooks/useAddDuplicatedRecordToCache';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { CoreObjectNameSingular, CrudOperationType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
import { DuplicateMessageListDocument } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useDuplicateMessageList = () => {
+ const { t } = useLingui();
const { addDuplicatedRecordToCache } = useAddDuplicatedRecordToCache({
objectNameSingular: CoreObjectNameSingular.MessageList,
});
diff --git a/packages/twenty-front/src/modules/dashboards/hooks/useDuplicateDashboard.ts b/packages/twenty-front/src/modules/dashboards/hooks/useDuplicateDashboard.ts
index e93a9662609..e80638aef9a 100644
--- a/packages/twenty-front/src/modules/dashboards/hooks/useDuplicateDashboard.ts
+++ b/packages/twenty-front/src/modules/dashboards/hooks/useDuplicateDashboard.ts
@@ -2,13 +2,14 @@ import { useMetadataErrorHandler } from '@/metadata-error-handler/hooks/useMetad
import { useAddDuplicatedRecordToCache } from '@/object-record/cache/hooks/useAddDuplicatedRecordToCache';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { CoreObjectNameSingular, CrudOperationType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
import { DuplicateDashboardDocument } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useDuplicateDashboard = () => {
+ const { t } = useLingui();
const { addDuplicatedRecordToCache } = useAddDuplicatedRecordToCache({
objectNameSingular: CoreObjectNameSingular.Dashboard,
});
diff --git a/packages/twenty-front/src/modules/file/components/AttachmentChip.tsx b/packages/twenty-front/src/modules/file/components/AttachmentChip.tsx
index 9329d739e6f..498c57ae875 100644
--- a/packages/twenty-front/src/modules/file/components/AttachmentChip.tsx
+++ b/packages/twenty-front/src/modules/file/components/AttachmentChip.tsx
@@ -1,5 +1,4 @@
import { AvatarOrIcon } from '@/ui/field/display/components/internal/AvatarOrIcon/AvatarOrIcon';
-import { t } from '@lingui/core/macro';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconX } from 'twenty-ui/icon';
import { Chip } from 'twenty-ui/primitives/data-display';
@@ -7,6 +6,7 @@ import { Chip } from 'twenty-ui/primitives/data-display';
import { getFileType } from '@/activities/files/utils/getFileType';
import { useFileCategoryColors } from '@/file/hooks/useFileCategoryColors';
import { IconMapping } from '@/file/utils/fileIconMappings';
+import { useLingui } from '@lingui/react/macro';
const ATTACHMENT_CHIP_MAX_WIDTH = 140;
@@ -21,6 +21,7 @@ export const AttachmentChip = ({
onRemove,
readonly = false,
}: AttachmentChipProps) => {
+ const { t } = useLingui();
const iconColors = useFileCategoryColors();
const fileType = getFileType(file.name);
diff --git a/packages/twenty-front/src/modules/file/hooks/useDirectFileUpload.ts b/packages/twenty-front/src/modules/file/hooks/useDirectFileUpload.ts
index 8a6973bfedc..602028da980 100644
--- a/packages/twenty-front/src/modules/file/hooks/useDirectFileUpload.ts
+++ b/packages/twenty-front/src/modules/file/hooks/useDirectFileUpload.ts
@@ -1,6 +1,5 @@
import { putFileToUploadTarget } from '@/file/utils/putFileToUploadTarget';
import { useApolloClient, useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import {
CompleteFileUploadDocument,
@@ -8,6 +7,7 @@ import {
type FileFolder,
type FileWithSignedUrl,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type DirectFileUploadOptions = {
fileFolder: FileFolder;
@@ -16,6 +16,7 @@ type DirectFileUploadOptions = {
};
export const useDirectFileUpload = () => {
+ const { t } = useLingui();
const apolloClient = useApolloClient();
const [createFileUpload] = useMutation(CreateFileUploadDocument, {
client: apolloClient,
diff --git a/packages/twenty-front/src/modules/front-components/media-session/components/FrontComponentMediaPermissionModal.tsx b/packages/twenty-front/src/modules/front-components/media-session/components/FrontComponentMediaPermissionModal.tsx
index 2798f29002b..c7f091e7f8b 100644
--- a/packages/twenty-front/src/modules/front-components/media-session/components/FrontComponentMediaPermissionModal.tsx
+++ b/packages/twenty-front/src/modules/front-components/media-session/components/FrontComponentMediaPermissionModal.tsx
@@ -5,7 +5,6 @@ import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFla
import { DialogInstance } from '@/ui/layout/dialog/components/DialogInstance';
import { useMutation } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { PermissionFlagType } from 'twenty-shared/constants';
import { isDefined } from 'twenty-shared/utils';
@@ -13,6 +12,7 @@ import { MainButton } from 'twenty-ui/components/input';
import { Dialog } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
import { GrantApplicationCapabilitiesDocument } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type FrontComponentMediaPermissionModalProps = {
applicationId: string;
@@ -40,6 +40,7 @@ export const FrontComponentMediaPermissionModal = ({
modalInstanceId,
request,
}: FrontComponentMediaPermissionModalProps) => {
+ const { t } = useLingui();
const canManageApps = useHasPermissionFlag(PermissionFlagType.APPLICATIONS);
const [grantCapabilities, { loading }] = useMutation(
GrantApplicationCapabilitiesDocument,
diff --git a/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx b/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx
index c1a1a43b7fc..25fdf46f69d 100644
--- a/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx
+++ b/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx
@@ -2,7 +2,6 @@ import { InformationBannerComponentInstanceContext } from '@/information-banner/
import { informationBannerIsOpenComponentState } from '@/information-banner/states/informationBannerIsOpenComponentState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { type IconComponent } from 'twenty-ui/icon';
@@ -13,6 +12,7 @@ import {
type BannerVariant,
} from 'twenty-ui/primitives/feedback';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledText = styled.div`
min-width: 0;
@@ -50,6 +50,7 @@ export const InformationBanner = ({
onClose?: () => void;
componentInstanceId: string;
}) => {
+ const { t } = useLingui();
const informationBannerIsOpen = useAtomComponentStateValue(
informationBannerIsOpenComponentState,
componentInstanceId,
diff --git a/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerBillingSubscriptionPaused.tsx b/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerBillingSubscriptionPaused.tsx
index a3844f4e72e..dedcea79980 100644
--- a/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerBillingSubscriptionPaused.tsx
+++ b/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerBillingSubscriptionPaused.tsx
@@ -3,15 +3,16 @@ import { useRedirect } from '@/domain-manager/hooks/useRedirect';
import { InformationBanner } from '@/information-banner/components/InformationBanner';
import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
import {
BillingPortalSessionDocument,
PermissionFlagType,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const InformationBannerBillingSubscriptionPaused = () => {
+ const { t } = useLingui();
const { redirect } = useRedirect();
const hasPermissionToUpdateBillingDetails = useHasPermissionFlag(
diff --git a/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerFailPaymentInfo.tsx b/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerFailPaymentInfo.tsx
index 629ddbbd0cd..24f0564beba 100644
--- a/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerFailPaymentInfo.tsx
+++ b/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerFailPaymentInfo.tsx
@@ -1,12 +1,13 @@
import { InformationBanner } from '@/information-banner/components/InformationBanner';
import { UpdatePaymentMethodModal } from '@/settings/billing/components/UpdatePaymentMethodModal';
import { usePaymentMethodFlow } from '@/settings/billing/hooks/usePaymentMethodFlow';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
const FAILED_PAYMENT_UPDATE_PAYMENT_MODAL_ID =
'failed-payment-update-payment-modal';
export const InformationBannerFailPaymentInfo = () => {
+ const { t } = useLingui();
const {
hasPermissionToManageBilling: hasPermissionToUpdateBillingDetails,
shouldAddPaymentMethodInProduct,
diff --git a/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerNoBillingSubscription.tsx b/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerNoBillingSubscription.tsx
index 2f2e3e41aaf..cd160ba4bdc 100644
--- a/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerNoBillingSubscription.tsx
+++ b/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerNoBillingSubscription.tsx
@@ -4,13 +4,13 @@ import { usePlans } from '@/settings/billing/hooks/usePlans';
import { getCheckoutPlanKeyOrThrow } from '@/settings/billing/utils/getCheckoutPlanKeyOrThrow';
import { InformationBanner } from '@/information-banner/components/InformationBanner';
import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import {
type BillingPlanKey,
PermissionFlagType,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type InformationBannerNoBillingSubscriptionContentProps = {
planKey: BillingPlanKey;
@@ -19,6 +19,7 @@ type InformationBannerNoBillingSubscriptionContentProps = {
const InformationBannerNoBillingSubscriptionContent = ({
planKey,
}: InformationBannerNoBillingSubscriptionContentProps) => {
+ const { t } = useLingui();
const { handleCheckoutSession, isSubmitting } = useHandleCheckoutSession({
recurringInterval: BILLING_CHECKOUT_SESSION_DEFAULT_VALUE.interval,
plan: planKey,
diff --git a/packages/twenty-front/src/modules/information-banner/components/deleted-record/InformationBannerDeletedRecord.tsx b/packages/twenty-front/src/modules/information-banner/components/deleted-record/InformationBannerDeletedRecord.tsx
index 59bdff5d583..08017700464 100644
--- a/packages/twenty-front/src/modules/information-banner/components/deleted-record/InformationBannerDeletedRecord.tsx
+++ b/packages/twenty-front/src/modules/information-banner/components/deleted-record/InformationBannerDeletedRecord.tsx
@@ -1,8 +1,8 @@
import { InformationBanner } from '@/information-banner/components/InformationBanner';
import { useRestoreManyRecords } from '@/object-record/hooks/useRestoreManyRecords';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { IconRefresh } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
const StyledInformationBannerDeletedRecord = styled.div`
height: 40px;
@@ -20,6 +20,7 @@ export const InformationBannerDeletedRecord = ({
recordId: string;
objectNameSingular: string;
}) => {
+ const { t } = useLingui();
const { restoreManyRecords } = useRestoreManyRecords({
objectNameSingular,
});
diff --git a/packages/twenty-front/src/modules/information-banner/components/enterprise/InformationBannerNonProductionInstance.tsx b/packages/twenty-front/src/modules/information-banner/components/enterprise/InformationBannerNonProductionInstance.tsx
index bf342bd6194..f2e3b80e953 100644
--- a/packages/twenty-front/src/modules/information-banner/components/enterprise/InformationBannerNonProductionInstance.tsx
+++ b/packages/twenty-front/src/modules/information-banner/components/enterprise/InformationBannerNonProductionInstance.tsx
@@ -1,11 +1,12 @@
import { enterpriseInstanceTypeState } from '@/client-config/states/enterpriseInstanceTypeState';
import { InformationBanner } from '@/information-banner/components/InformationBanner';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { ENTERPRISE_INSTANCE_TYPE } from 'twenty-shared/constants';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
export const InformationBannerNonProductionInstance = () => {
+ const { t } = useLingui();
const enterpriseInstanceType = useAtomStateValue(enterpriseInstanceTypeState);
if (
diff --git a/packages/twenty-front/src/modules/information-banner/components/impersonate/InformationBannerIsImpersonating.tsx b/packages/twenty-front/src/modules/information-banner/components/impersonate/InformationBannerIsImpersonating.tsx
index 91b540eab22..6764813b711 100644
--- a/packages/twenty-front/src/modules/information-banner/components/impersonate/InformationBannerIsImpersonating.tsx
+++ b/packages/twenty-front/src/modules/information-banner/components/impersonate/InformationBannerIsImpersonating.tsx
@@ -2,12 +2,13 @@ import { useImpersonationSession } from '@/auth/hooks/useImpersonationSession';
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { isImpersonatingState } from '@/auth/states/isImpersonatingState';
import { InformationBanner } from '@/information-banner/components/InformationBanner';
-import { t } from '@lingui/core/macro';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { isDefined } from 'twenty-shared/utils';
import { IconLogout } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const InformationBannerIsImpersonating = () => {
+ const { t } = useLingui();
const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
const isImpersonating = useAtomStateValue(isImpersonatingState);
diff --git a/packages/twenty-front/src/modules/information-banner/components/maintenance/InformationBannerMaintenance.tsx b/packages/twenty-front/src/modules/information-banner/components/maintenance/InformationBannerMaintenance.tsx
index 7695f616655..fac4745b5b3 100644
--- a/packages/twenty-front/src/modules/information-banner/components/maintenance/InformationBannerMaintenance.tsx
+++ b/packages/twenty-front/src/modules/information-banner/components/maintenance/InformationBannerMaintenance.tsx
@@ -5,10 +5,10 @@ import { InformationBanner } from '@/information-banner/components/InformationBa
import { useMaintenanceModeBannerDismissal } from '@/information-banner/hooks/useMaintenanceModeBannerDismissal';
import { useDateTimeFormat } from '@/localization/hooks/useDateTimeFormat';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { getSafeUrl, isDefined } from 'twenty-shared/utils';
import { IconExternalLink } from 'twenty-ui/icon';
import { openUrlInNewTab } from '~/utils/openUrlInNewTab';
+import { useLingui } from '@lingui/react/macro';
const formatMaintenanceDateTime = (
isoString: string,
@@ -27,6 +27,7 @@ const formatMaintenanceDateTime = (
};
export const InformationBannerMaintenance = () => {
+ const { t } = useLingui();
const maintenanceMode = useAtomStateValue(maintenanceModeState);
const { timeZone } = useDateTimeFormat();
const { dismissBanner, isDismissed, isLoading } =
diff --git a/packages/twenty-front/src/modules/information-banner/components/reconnect-account/InformationBannerReconnectAccountEmailAliases.tsx b/packages/twenty-front/src/modules/information-banner/components/reconnect-account/InformationBannerReconnectAccountEmailAliases.tsx
index eb997d208b5..af992569feb 100644
--- a/packages/twenty-front/src/modules/information-banner/components/reconnect-account/InformationBannerReconnectAccountEmailAliases.tsx
+++ b/packages/twenty-front/src/modules/information-banner/components/reconnect-account/InformationBannerReconnectAccountEmailAliases.tsx
@@ -3,13 +3,14 @@ import { useAccountToReconnect } from '@/information-banner/hooks/useAccountToRe
import { useDismissReconnectAccountBanner } from '@/information-banner/hooks/useDismissReconnectAccountBanner';
import { InformationBannerKeys } from '@/information-banner/types/InformationBannerKeys';
import { useTriggerProviderReconnect } from '@/settings/accounts/hooks/useTriggerProviderReconnect';
-import { t } from '@lingui/core/macro';
import { IconRefresh } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
const COMPONENT_INSTANCE_ID =
'information-banner-reconnect-account-email-aliases';
export const InformationBannerReconnectAccountEmailAliases = () => {
+ const { t } = useLingui();
const { accountToReconnect } = useAccountToReconnect(
InformationBannerKeys.ACCOUNTS_TO_RECONNECT_EMAIL_ALIASES,
);
diff --git a/packages/twenty-front/src/modules/information-banner/components/reconnect-account/InformationBannerReconnectAccountInsufficientPermissions.tsx b/packages/twenty-front/src/modules/information-banner/components/reconnect-account/InformationBannerReconnectAccountInsufficientPermissions.tsx
index d1ca5cf3cd5..f6ddb0b31dc 100644
--- a/packages/twenty-front/src/modules/information-banner/components/reconnect-account/InformationBannerReconnectAccountInsufficientPermissions.tsx
+++ b/packages/twenty-front/src/modules/information-banner/components/reconnect-account/InformationBannerReconnectAccountInsufficientPermissions.tsx
@@ -3,13 +3,14 @@ import { useAccountToReconnect } from '@/information-banner/hooks/useAccountToRe
import { useDismissReconnectAccountBanner } from '@/information-banner/hooks/useDismissReconnectAccountBanner';
import { InformationBannerKeys } from '@/information-banner/types/InformationBannerKeys';
import { useTriggerProviderReconnect } from '@/settings/accounts/hooks/useTriggerProviderReconnect';
-import { t } from '@lingui/core/macro';
import { IconRefresh } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
const COMPONENT_INSTANCE_ID =
'information-banner-reconnect-account-insufficient-permissions';
export const InformationBannerReconnectAccountInsufficientPermissions = () => {
+ const { t } = useLingui();
const { accountToReconnect } = useAccountToReconnect(
InformationBannerKeys.ACCOUNTS_TO_RECONNECT_INSUFFICIENT_PERMISSIONS,
);
diff --git a/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuDialog.tsx b/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuDialog.tsx
index f381daff642..2397c146b3e 100644
--- a/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuDialog.tsx
+++ b/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuDialog.tsx
@@ -1,10 +1,10 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { IconButton } from 'twenty-ui/components/input';
import { IconX } from 'twenty-ui/icon';
import { Dialog } from 'twenty-ui/primitives/surfaces';
import { RootStackingContextZIndices } from '@/ui/layout/constants/RootStackingContextZIndices';
+import { useLingui } from '@lingui/react/macro';
const StyledOverlay = styled.div`
inset: 0;
@@ -38,41 +38,44 @@ export const KeyboardMenuDialog = ({
open,
onClose,
children,
-}: KeyboardMenuDialogProps) => (
- <Dialog.Root
- open={open}
- onOpenChange={(isOpen) => {
- if (!isOpen) {
- onClose();
- }
- }}
- >
- <Dialog.Portal>
- <StyledOverlay>
- <Dialog.Backdrop />
- <Dialog.Viewport>
- <Dialog.Popup size="md">
- <Dialog.Header render={<StyledHeading />}>
- <Dialog.Title render={<StyledTitle />}>
- {t`Keyboard shortcuts`}
- </Dialog.Title>
- <Dialog.Close
- render={
- <IconButton
- aria-label={t`Close keyboard shortcuts`}
- variant="ghost"
- >
- <IconX />
- </IconButton>
- }
- />
- </Dialog.Header>
- <Dialog.Body>
- <StyledGroups>{children}</StyledGroups>
- </Dialog.Body>
- </Dialog.Popup>
- </Dialog.Viewport>
- </StyledOverlay>
- </Dialog.Portal>
- </Dialog.Root>
-);
+}: KeyboardMenuDialogProps) => {
+ const { t } = useLingui();
+ return (
+ <Dialog.Root
+ open={open}
+ onOpenChange={(isOpen) => {
+ if (!isOpen) {
+ onClose();
+ }
+ }}
+ >
+ <Dialog.Portal>
+ <StyledOverlay>
+ <Dialog.Backdrop />
+ <Dialog.Viewport>
+ <Dialog.Popup size="md">
+ <Dialog.Header render={<StyledHeading />}>
+ <Dialog.Title render={<StyledTitle />}>
+ {t`Keyboard shortcuts`}
+ </Dialog.Title>
+ <Dialog.Close
+ render={
+ <IconButton
+ aria-label={t`Close keyboard shortcuts`}
+ variant="ghost"
+ >
+ <IconX />
+ </IconButton>
+ }
+ />
+ </Dialog.Header>
+ <Dialog.Body>
+ <StyledGroups>{children}</StyledGroups>
+ </Dialog.Body>
+ </Dialog.Popup>
+ </Dialog.Viewport>
+ </StyledOverlay>
+ </Dialog.Portal>
+ </Dialog.Root>
+ );
+};
diff --git a/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuItem.tsx b/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuItem.tsx
index aa9e7ba16b8..aea713e86f4 100644
--- a/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuItem.tsx
+++ b/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuItem.tsx
@@ -1,10 +1,10 @@
import { type Shortcut as ShortcutMenuEntry } from '@/keyboard-shortcut-menu/types/Shortcut';
import { useShortcutAccessibleKeyLabels } from '@/ui/navigation/hooks/useShortcutAccessibleKeyLabels';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Fragment } from 'react';
import { Shortcut } from 'twenty-ui/primitives/typography';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledItem = styled.div`
align-items: center;
@@ -27,6 +27,7 @@ type KeyboardMenuItemProps = {
};
export const KeyboardMenuItem = ({ shortcut }: KeyboardMenuItemProps) => {
+ const { t } = useLingui();
const accessibleKeyLabels = useShortcutAccessibleKeyLabels();
return (
diff --git a/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuOpenContent.tsx b/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuOpenContent.tsx
index b5460c58e8c..43bc0d2bd2e 100644
--- a/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuOpenContent.tsx
+++ b/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuOpenContent.tsx
@@ -5,12 +5,13 @@ import { KEYBOARD_SHORTCUTS_TABLE } from '@/keyboard-shortcut-menu/constants/Key
import { useKeyboardShortcutMenu } from '@/keyboard-shortcut-menu/hooks/useKeyboardShortcutMenu';
import { isKeyboardShortcutMenuOpenedState } from '@/keyboard-shortcut-menu/states/isKeyboardShortcutMenuOpenedState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { KeyboardMenuDialog } from './KeyboardShortcutMenuDialog';
import { KeyboardMenuGroup } from './KeyboardShortcutMenuGroup';
import { KeyboardMenuItem } from './KeyboardShortcutMenuItem';
+import { useLingui } from '@lingui/react/macro';
export const KeyboardShortcutMenuOpenContent = () => {
+ const { t } = useLingui();
const { closeKeyboardShortcutMenu } = useKeyboardShortcutMenu();
const isKeyboardShortcutMenuOpened = useAtomStateValue(
isKeyboardShortcutMenuOpenedState,
diff --git a/packages/twenty-front/src/modules/logic-functions/components/LogicFunctionExecutionResult.tsx b/packages/twenty-front/src/modules/logic-functions/components/LogicFunctionExecutionResult.tsx
index b24399ba55e..09a072393b5 100644
--- a/packages/twenty-front/src/modules/logic-functions/components/LogicFunctionExecutionResult.tsx
+++ b/packages/twenty-front/src/modules/logic-functions/components/LogicFunctionExecutionResult.tsx
@@ -1,10 +1,10 @@
-import { t } from '@lingui/core/macro';
import {
type ExecutionStatus,
WorkflowStepExecutionResult,
} from '@/workflow/components/WorkflowStepExecutionResult';
import { type LogicFunctionTestData } from '@/workflow/workflow-steps/workflow-actions/code-action/states/logicFunctionTestDataFamilyState';
import { LogicFunctionExecutionStatus } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const LogicFunctionExecutionResult = ({
logicFunctionTestData,
@@ -13,6 +13,7 @@ export const LogicFunctionExecutionResult = ({
logicFunctionTestData: LogicFunctionTestData;
isTesting?: boolean;
}) => {
+ const { t } = useLingui();
const result =
logicFunctionTestData.output.data ||
logicFunctionTestData.output.error ||
diff --git a/packages/twenty-front/src/modules/marketplace/components/SettingsApplicationInstallPermissionValidationModal.tsx b/packages/twenty-front/src/modules/marketplace/components/SettingsApplicationInstallPermissionValidationModal.tsx
index afa6e1247fb..6e40f5c4a74 100644
--- a/packages/twenty-front/src/modules/marketplace/components/SettingsApplicationInstallPermissionValidationModal.tsx
+++ b/packages/twenty-front/src/modules/marketplace/components/SettingsApplicationInstallPermissionValidationModal.tsx
@@ -13,7 +13,6 @@ import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadat
import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
import { TooltipDelay } from '@/ui/layout/tooltip/constants/TooltipDelay';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useMemo } from 'react';
import { type RoleManifest } from 'twenty-shared/application';
import { type IframeMediaPermission } from 'twenty-shared/types';
@@ -22,6 +21,7 @@ import { InlineBanner } from 'twenty-ui/components/feedback';
import { LightButton } from 'twenty-ui/components/input';
import { IconAlertTriangle, IconChevronLeft } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type MarketplaceAppObject = {
universalIdentifier: string;
@@ -146,6 +146,7 @@ export const SettingsApplicationInstallPermissionValidationModal = ({
onAuthorize,
isInstalling,
}: SettingsApplicationInstallPermissionValidationModalProps) => {
+ const { t } = useLingui();
const { closeDialog } = useDialog();
const { objectMetadataItems } = useObjectMetadataItems();
@@ -187,7 +188,9 @@ export const SettingsApplicationInstallPermissionValidationModal = ({
),
...buildApplicationBillingSummary(billsCredits),
];
+ // The summary builders translate through the global i18n
}, [
+ t,
requestedCapabilities,
requestedIframeMediaPermissions,
defaultRole,
diff --git a/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceApp.ts b/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceApp.ts
index ea7c9184945..466b4e5b91a 100644
--- a/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceApp.ts
+++ b/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceApp.ts
@@ -4,7 +4,6 @@ import { type TrackedJobStatus } from '@/queue-job/types/TrackedJobStatus';
import { isTerminalJobState } from '@/queue-job/utils/isTerminalJobState';
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { useLazyQuery, useMutation, useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useCallback } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -16,6 +15,7 @@ import {
JobState,
TriggerInstallApplicationDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type UseInstallMarketplaceAppArgs = {
universalIdentifier?: string;
@@ -28,6 +28,7 @@ export const useInstallMarketplaceApp = ({
universalIdentifier,
onCompleted,
}: UseInstallMarketplaceAppArgs = {}) => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const [triggerInstallApplication, { loading: isTriggeringInstall }] =
useMutation(TriggerInstallApplicationDocument);
@@ -120,7 +121,13 @@ export const useInstallMarketplaceApp = ({
});
onCompleted?.(installedApplication);
},
- [enqueueToast, findInstalledApplication, onCompleted, setCurrentWorkspace],
+ [
+ enqueueToast,
+ findInstalledApplication,
+ onCompleted,
+ setCurrentWorkspace,
+ t,
+ ],
);
const fetchInstallJobStatus = useCallback(
diff --git a/packages/twenty-front/src/modules/marketplace/hooks/useUpgradeApplication.ts b/packages/twenty-front/src/modules/marketplace/hooks/useUpgradeApplication.ts
index 9fa06aadef2..a05dc7f2e2e 100644
--- a/packages/twenty-front/src/modules/marketplace/hooks/useUpgradeApplication.ts
+++ b/packages/twenty-front/src/modules/marketplace/hooks/useUpgradeApplication.ts
@@ -2,7 +2,6 @@ import { useTrackedQueueJob } from '@/queue-job/hooks/useTrackedQueueJob';
import { type TrackedJobStatus } from '@/queue-job/types/TrackedJobStatus';
import { isTerminalJobState } from '@/queue-job/utils/isTerminalJobState';
import { useLazyQuery, useMutation, useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useCallback } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -12,6 +11,7 @@ import {
JobState,
TriggerUpgradeApplicationDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type UseUpgradeApplicationArgs = {
universalIdentifier?: string;
@@ -22,6 +22,7 @@ export const useUpgradeApplication = ({
universalIdentifier,
onCompleted,
}: UseUpgradeApplicationArgs = {}) => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const [triggerUpgradeApplication, { loading: isTriggeringUpgrade }] =
useMutation(TriggerUpgradeApplicationDocument);
@@ -69,7 +70,7 @@ export const useUpgradeApplication = ({
});
onCompleted?.();
},
- [enqueueToast, onCompleted],
+ [enqueueToast, onCompleted, t],
);
const fetchUpgradeJobStatus = useCallback(
diff --git a/packages/twenty-front/src/modules/media-access/components/MediaAccessIndicator.tsx b/packages/twenty-front/src/modules/media-access/components/MediaAccessIndicator.tsx
index eb9909cfbbd..c3ab54bdc88 100644
--- a/packages/twenty-front/src/modules/media-access/components/MediaAccessIndicator.tsx
+++ b/packages/twenty-front/src/modules/media-access/components/MediaAccessIndicator.tsx
@@ -2,12 +2,12 @@ import { MediaAccessSessionRow } from '@/media-access/components/MediaAccessSess
import { mediaAccessSessionsState } from '@/media-access/states/mediaAccessSessionsState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import groupBy from 'lodash.groupby';
import { isNonEmptyArray } from 'twenty-shared/utils';
import { LightIconButton } from 'twenty-ui/components/input';
import { Popover } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledDot = styled.span<{ isCapturing: boolean }>`
background: ${({ isCapturing }) =>
@@ -34,6 +34,7 @@ const StyledApplications = styled.div`
`;
export const MediaAccessIndicator = () => {
+ const { t } = useLingui();
const mediaAccessSessions = useAtomStateValue(mediaAccessSessionsState);
if (!isNonEmptyArray(mediaAccessSessions)) {
diff --git a/packages/twenty-front/src/modules/media-access/components/MediaAccessSessionRow.tsx b/packages/twenty-front/src/modules/media-access/components/MediaAccessSessionRow.tsx
index a13e147b53b..821248d69dc 100644
--- a/packages/twenty-front/src/modules/media-access/components/MediaAccessSessionRow.tsx
+++ b/packages/twenty-front/src/modules/media-access/components/MediaAccessSessionRow.tsx
@@ -1,10 +1,10 @@
import { type MediaAccessSession } from '@/media-access/types/MediaAccessSession';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconMicrophone, IconVideo } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { themeCssVariables, useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledRow = styled.div`
align-items: center;
@@ -36,6 +36,7 @@ export const MediaAccessSessionRow = ({
}: {
sessions: MediaAccessSession[];
}) => {
+ const { t } = useLingui();
const theme = useTheme();
const firstSession = sessions[0];
diff --git a/packages/twenty-front/src/modules/mention/components/MentionRecordChip.tsx b/packages/twenty-front/src/modules/mention/components/MentionRecordChip.tsx
index 98c2a2127b9..107aa6ccef3 100644
--- a/packages/twenty-front/src/modules/mention/components/MentionRecordChip.tsx
+++ b/packages/twenty-front/src/modules/mention/components/MentionRecordChip.tsx
@@ -2,10 +2,10 @@ import { getChipLabel } from '@/ui/field/display/utils/getChipLabel';
import { getLinkToShowPage } from '@/object-metadata/utils/getLinkToShowPage';
import { AvatarOrIcon } from '@/ui/field/display/components/internal/AvatarOrIcon/AvatarOrIcon';
import { LinkChip } from '@/ui/navigation/link/components/LinkChip/LinkChip';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { Chip } from 'twenty-ui/primitives/data-display';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
+import { useLingui } from '@lingui/react/macro';
type MentionRecordChipProps = {
recordId: string;
@@ -20,6 +20,7 @@ export const MentionRecordChip = ({
label,
imageUrl,
}: MentionRecordChipProps) => {
+ const { t } = useLingui();
if (!isNonEmptyString(objectNameSingular)) {
return <Chip variant="plain" aria-disabled>{t`Unknown object`}</Chip>;
}
diff --git a/packages/twenty-front/src/modules/metadata-error-handler/hooks/useMetadataErrorHandler.ts b/packages/twenty-front/src/modules/metadata-error-handler/hooks/useMetadataErrorHandler.ts
index 94473724d69..39ab47f5258 100644
--- a/packages/twenty-front/src/modules/metadata-error-handler/hooks/useMetadataErrorHandler.ts
+++ b/packages/twenty-front/src/modules/metadata-error-handler/hooks/useMetadataErrorHandler.ts
@@ -1,6 +1,4 @@
import { type CombinedGraphQLErrors } from '@apollo/client/errors';
-import { t } from '@lingui/core/macro';
-
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
import { classifyMetadataError } from '@/metadata-error-handler/utils/classifyMetadataError';
import {
@@ -9,8 +7,10 @@ import {
} from 'twenty-shared/metadata';
import { CrudOperationType } from 'twenty-shared/types';
import { useToast } from 'twenty-ui/components/feedback';
+import { useLingui } from '@lingui/react/macro';
export const useMetadataErrorHandler = () => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const TRANSLATED_OPERATION_TYPE = {
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderContent.tsx b/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderContent.tsx
index b9d170d3180..718acc6c831 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderContent.tsx
+++ b/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderContent.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { NavigationMenuItemType } from 'twenty-shared/types';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconHeartOff } from 'twenty-ui/icon';
@@ -18,6 +17,7 @@ import { objectMetadataItemsSelector } from '@/object-metadata/states/objectMeta
import { NavigationDrawerItem } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItem';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { viewsSelector } from '@/views/states/selectors/viewsSelector';
+import { useLingui } from '@lingui/react/macro';
type NavigationMenuItemFolderContentProps = {
folderId: string;
@@ -30,6 +30,7 @@ export const NavigationMenuItemFolderContent = ({
folderId,
navigationMenuItems,
}: NavigationMenuItemFolderContentProps) => {
+ const { t } = useLingui();
const objectMetadataItems = useAtomStateValue(objectMetadataItemsSelector);
const views = useAtomStateValue(viewsSelector);
const lastVisitedViewPerObjectMetadataItem = useAtomStateValue(
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/display/folder/hooks/useNavigationMenuItemsByFolder.ts b/packages/twenty-front/src/modules/navigation-menu-item/display/folder/hooks/useNavigationMenuItemsByFolder.ts
index 85e93b44f25..05607293228 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/display/folder/hooks/useNavigationMenuItemsByFolder.ts
+++ b/packages/twenty-front/src/modules/navigation-menu-item/display/folder/hooks/useNavigationMenuItemsByFolder.ts
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { type NavigationMenuItem } from '~/generated-metadata/graphql';
@@ -9,6 +8,7 @@ import { viewsSelector } from '@/views/states/selectors/viewsSelector';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useNavigationMenuItemsData } from '@/navigation-menu-item/display/hooks/useNavigationMenuItemsData';
+import { useLingui } from '@lingui/react/macro';
type NavigationMenuItemFolder = {
id: string;
@@ -24,6 +24,7 @@ type NavigationMenuItemFolderEntry = Pick<
>;
export const useNavigationMenuItemsByFolder = () => {
+ const { t } = useLingui();
const views = useAtomStateValue(viewsSelector);
const objectMetadataItems = useNavigationObjectMetadataItems();
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/display/object/components/NavigationDrawerItemForObjectMetadataItem.tsx b/packages/twenty-front/src/modules/navigation-menu-item/display/object/components/NavigationDrawerItemForObjectMetadataItem.tsx
index e4d821a3ce2..ed99c74474c 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/display/object/components/NavigationDrawerItemForObjectMetadataItem.tsx
+++ b/packages/twenty-front/src/modules/navigation-menu-item/display/object/components/NavigationDrawerItemForObjectMetadataItem.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { Fragment, type ReactNode } from 'react';
@@ -33,6 +32,7 @@ import { useIcons } from 'twenty-ui/icon/provider';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { type NavigationMenuItem } from '~/generated-metadata/graphql';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
+import { useLingui } from '@lingui/react/macro';
export type NavigationDrawerItemForObjectMetadataItemProps = {
objectMetadataItem: EnrichedObjectMetadataItem;
@@ -53,6 +53,7 @@ export const NavigationDrawerItemForObjectMetadataItem = ({
isDragging = false,
rightOptions,
}: NavigationDrawerItemForObjectMetadataItemProps) => {
+ const { t } = useLingui();
const isLayoutCustomizationModeEnabled = useAtomStateValue(
isLayoutCustomizationModeEnabledState,
);
diff --git a/packages/twenty-front/src/modules/navigation/components/MultiWorkspaceDropdown/internal/components/AvailableWorkspaceItem.tsx b/packages/twenty-front/src/modules/navigation/components/MultiWorkspaceDropdown/internal/components/AvailableWorkspaceItem.tsx
index 9040217102f..08415c900eb 100644
--- a/packages/twenty-front/src/modules/navigation/components/MultiWorkspaceDropdown/internal/components/AvailableWorkspaceItem.tsx
+++ b/packages/twenty-front/src/modules/navigation/components/MultiWorkspaceDropdown/internal/components/AvailableWorkspaceItem.tsx
@@ -3,12 +3,12 @@ import { useBuildWorkspaceUrl } from '@/domain-manager/hooks/useBuildWorkspaceUr
import { useRedirectToWorkspaceDomain } from '@/domain-manager/hooks/useRedirectToWorkspaceDomain';
import { DEFAULT_WORKSPACE_LOGO } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceLogo';
import { getWorkspaceAvatarColorSeed } from '@/workspace/utils/getWorkspaceAvatarColorSeed';
-import { t } from '@lingui/core/macro';
import { Avatar } from 'twenty-ui/primitives/data-display';
import { Dropdown } from 'twenty-ui/components/navigation';
import { type AvailableWorkspace } from '~/generated-metadata/graphql';
import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
+import { useLingui } from '@lingui/react/macro';
export const AvailableWorkspaceItem = ({
availableWorkspace,
@@ -17,6 +17,7 @@ export const AvailableWorkspaceItem = ({
availableWorkspace: AvailableWorkspace;
isSelected: boolean;
}) => {
+ const { t } = useLingui();
const { buildWorkspaceUrl } = useBuildWorkspaceUrl();
const { redirectToWorkspaceDomain } = useRedirectToWorkspaceDomain();
diff --git a/packages/twenty-front/src/modules/navigation/components/NavigationDrawerHeader.tsx b/packages/twenty-front/src/modules/navigation/components/NavigationDrawerHeader.tsx
index 28c96093e30..77b64d4e505 100644
--- a/packages/twenty-front/src/modules/navigation/components/NavigationDrawerHeader.tsx
+++ b/packages/twenty-front/src/modules/navigation/components/NavigationDrawerHeader.tsx
@@ -1,7 +1,6 @@
import { MediaAccessIndicator } from '@/media-access/components/MediaAccessIndicator';
import { APP_HEADER_HEIGHT } from '@/ui/layout/constants/AppHeaderHeight';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconSearch } from 'twenty-ui/icon';
import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme';
@@ -11,6 +10,7 @@ import { useOpenRecordsSearchPageInSidePanel } from '@/side-panel/hooks/useOpenR
import { MultiWorkspaceDropdownButton } from '@/navigation/components/MultiWorkspaceDropdown/MultiWorkspaceDropdownButton';
import { useIsMobile } from 'twenty-ui/utilities';
import { NavigationDrawerCollapseButton } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerCollapseButton';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
flex-shrink: 0;
@@ -54,6 +54,7 @@ const StyledWorkspaceDropdownContainer = styled.div`
`;
export const NavigationDrawerHeader = () => {
+ const { t } = useLingui();
const isMobile = useIsMobile();
const { openRecordsSearchPage } = useOpenRecordsSearchPageInSidePanel();
const isExpanded = useIsNavigationDrawerContentExpanded();
diff --git a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentFormContent.tsx b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentFormContent.tsx
index 39d2e587700..7bc4b9cada3 100644
--- a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentFormContent.tsx
+++ b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentFormContent.tsx
@@ -1,6 +1,5 @@
import { getAgentIcon } from '@/object-core/agents/utils/getAgentIcon';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
@@ -38,6 +37,7 @@ import { getCoreAgentInitialFormValues } from '@/object-core/agents/utils/getCor
import { isCoreAgentRoleDirty } from '@/object-core/agents/utils/isCoreAgentRoleDirty';
import { isOwnedByInstalledApplication } from '@/applications/utils/isOwnedByInstalledApplication';
import { getIsMetadataItemCustom } from '@/object-metadata/utils/getIsMetadataItemCustom';
+import { useLingui } from '@lingui/react/macro';
const StyledContentContainer = styled.div`
display: flex;
@@ -52,6 +52,7 @@ type CoreAgentFormContentProps = {
};
export const CoreAgentFormContent = ({ agent }: CoreAgentFormContentProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const { getIcon } = useIcons();
const currentWorkspace = useAtomStateValue(currentWorkspaceState);
diff --git a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunDetails.tsx b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunDetails.tsx
index 79f6b0d9e9d..34a29b2ac23 100644
--- a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunDetails.tsx
+++ b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunDetails.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { Tag } from 'twenty-ui/primitives/data-display';
@@ -7,6 +6,7 @@ import { themeCssVariables } from 'twenty-ui/theme';
import { CoreAgentModelCell } from '@/object-core/agents/components/CoreAgentModelCell';
import { type CoreAgentRun } from '@/object-core/agents/types/CoreAgentRun';
+import { useLingui } from '@lingui/react/macro';
const StyledDetails = styled.div`
border-bottom: 1px solid ${themeCssVariables.border.color.light};
@@ -41,41 +41,44 @@ type CoreAgentRunDetailsProps = {
run: CoreAgentRun;
};
-export const CoreAgentRunDetails = ({ run }: CoreAgentRunDetailsProps) => (
- <StyledDetails>
- {isNonEmptyString(run.errorMessage) && (
- <>
- <StyledLabel>{t`Error`}</StyledLabel>
- <StyledError>{run.errorMessage}</StyledError>
- </>
- )}
- <StyledLabel>{t`Input`}</StyledLabel>
- <StyledText>{run.input ?? t`No input`}</StyledText>
- <StyledLabel>{t`Reply`}</StyledLabel>
- <StyledText>{run.reply ?? t`No reply`}</StyledText>
- {isNonEmptyArray(run.toolNames) && (
- <>
- <StyledLabel>{t`Tools`}</StyledLabel>
- <StyledTags>
- {run.toolNames.map((toolName) => (
- <Tag key={toolName} color="gray">
- {toolName}
- </Tag>
- ))}
- </StyledTags>
- </>
- )}
- {isDefined(run.modelId) && (
- <>
- <StyledLabel>{t`Model`}</StyledLabel>
- <CoreAgentModelCell modelId={run.modelId} />
- </>
- )}
- {isNonEmptyString(run.threadTitle) && (
- <>
- <StyledLabel>{t`Conversation`}</StyledLabel>
- <StyledText>{run.threadTitle}</StyledText>
- </>
- )}
- </StyledDetails>
-);
+export const CoreAgentRunDetails = ({ run }: CoreAgentRunDetailsProps) => {
+ const { t } = useLingui();
+ return (
+ <StyledDetails>
+ {isNonEmptyString(run.errorMessage) && (
+ <>
+ <StyledLabel>{t`Error`}</StyledLabel>
+ <StyledError>{run.errorMessage}</StyledError>
+ </>
+ )}
+ <StyledLabel>{t`Input`}</StyledLabel>
+ <StyledText>{run.input ?? t`No input`}</StyledText>
+ <StyledLabel>{t`Reply`}</StyledLabel>
+ <StyledText>{run.reply ?? t`No reply`}</StyledText>
+ {isNonEmptyArray(run.toolNames) && (
+ <>
+ <StyledLabel>{t`Tools`}</StyledLabel>
+ <StyledTags>
+ {run.toolNames.map((toolName) => (
+ <Tag key={toolName} color="gray">
+ {toolName}
+ </Tag>
+ ))}
+ </StyledTags>
+ </>
+ )}
+ {isDefined(run.modelId) && (
+ <>
+ <StyledLabel>{t`Model`}</StyledLabel>
+ <CoreAgentModelCell modelId={run.modelId} />
+ </>
+ )}
+ {isNonEmptyString(run.threadTitle) && (
+ <>
+ <StyledLabel>{t`Conversation`}</StyledLabel>
+ <StyledText>{run.threadTitle}</StyledText>
+ </>
+ )}
+ </StyledDetails>
+ );
+};
diff --git a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunRow.tsx b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunRow.tsx
index f5443609056..4e4d5fcfe79 100644
--- a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunRow.tsx
+++ b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunRow.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { themeCssVariables } from 'twenty-ui/theme';
@@ -14,6 +13,7 @@ import { TableRow } from '@/ui/layout/table/components/TableRow';
import { formatDuration } from '~/utils/format/formatDuration';
import { beautifyPastDateRelativeToNow } from '~/utils/date-utils';
import { formatNumber } from '@/localization/utils/formatNumber';
+import { useLingui } from '@lingui/react/macro';
type CoreAgentRunRowProps = {
run: CoreAgentRun;
@@ -38,6 +38,7 @@ export const CoreAgentRunRow = ({
onToggle,
isNested = false,
}: CoreAgentRunRowProps) => {
+ const { t } = useLingui();
const tokens = getRunTokens(run);
const durationMs = getRunDurationMs(run);
diff --git a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunSource.tsx b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunSource.tsx
index 91e1e327188..b78ea0cc571 100644
--- a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunSource.tsx
+++ b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunSource.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { FieldActorSource } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import {
@@ -11,6 +10,7 @@ import {
} from 'twenty-ui/icon';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { themeCssVariables, useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
align-items: center;
@@ -37,6 +37,7 @@ export const CoreAgentRunSource = ({
creatorSource,
creatorName,
}: CoreAgentRunSourceProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const SourceIcon = SOURCE_ICONS[creatorSource];
diff --git a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunStatus.tsx b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunStatus.tsx
index 0cf754541b6..c97c828384a 100644
--- a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunStatus.tsx
+++ b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunStatus.tsx
@@ -1,14 +1,15 @@
-import { t } from '@lingui/core/macro';
import { assertUnreachable } from 'twenty-shared/utils';
import { Status } from 'twenty-ui/primitives/data-display';
import { AgentTurnStatus } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type CoreAgentRunStatusProps = {
status: AgentTurnStatus;
};
export const CoreAgentRunStatus = ({ status }: CoreAgentRunStatusProps) => {
+ const { t } = useLingui();
switch (status) {
case AgentTurnStatus.RUNNING:
return (
diff --git a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunsTab.tsx b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunsTab.tsx
index 64af5417db6..9b95ba91e22 100644
--- a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunsTab.tsx
+++ b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunsTab.tsx
@@ -1,6 +1,5 @@
import { useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
@@ -16,6 +15,7 @@ import { Table } from '@/ui/layout/table/components/Table';
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { GetAgentRunsDocument } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const RUNS_POLL_INTERVAL_MS = 10000;
@@ -44,6 +44,7 @@ type CoreAgentRunsTabProps = {
};
export const CoreAgentRunsTab = ({ agentId }: CoreAgentRunsTabProps) => {
+ const { t } = useLingui();
const [expandedRunIds, setExpandedRunIds] = useState<Set<string>>(new Set());
const [expandedThreadIds, setExpandedThreadIds] = useState<Set<string>>(
new Set(),
diff --git a/packages/twenty-front/src/modules/object-core/agents/hooks/useCoreAgentSave.ts b/packages/twenty-front/src/modules/object-core/agents/hooks/useCoreAgentSave.ts
index 4f3cac77d3e..854bbe484a1 100644
--- a/packages/twenty-front/src/modules/object-core/agents/hooks/useCoreAgentSave.ts
+++ b/packages/twenty-front/src/modules/object-core/agents/hooks/useCoreAgentSave.ts
@@ -1,6 +1,5 @@
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useEffect, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
@@ -14,6 +13,7 @@ import {
} from '~/generated-metadata/graphql';
import { type CoreAgentFormValues } from '@/object-core/agents/validation-schemas/coreAgentFormSchema';
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
+import { useLingui } from '@lingui/react/macro';
export const useCoreAgentSave = ({
agent,
@@ -30,6 +30,7 @@ export const useCoreAgentSave = ({
isRoleDirty: boolean;
validateForm: () => boolean;
}) => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const [isSubmitting, setIsSubmitting] = useState(false);
const [originalFormValues, setOriginalFormValues] =
diff --git a/packages/twenty-front/src/modules/object-core/components/CoreObjectIndexPageLayout.tsx b/packages/twenty-front/src/modules/object-core/components/CoreObjectIndexPageLayout.tsx
index cc184bab8fd..7cb047597a8 100644
--- a/packages/twenty-front/src/modules/object-core/components/CoreObjectIndexPageLayout.tsx
+++ b/packages/twenty-front/src/modules/object-core/components/CoreObjectIndexPageLayout.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconPlus } from 'twenty-ui/icon';
@@ -10,6 +9,7 @@ import { RecordIndexPageHeaderTitle } from '@/object-record/record-index/compone
import { PageCardHeader } from '@/ui/layout/page/components/PageCardHeader';
import { PageCardLayout } from '@/ui/layout/page/components/PageCardLayout';
import { PageTitle } from '@/ui/utilities/page-title/components/PageTitle';
+import { useLingui } from '@lingui/react/macro';
const StyledTableContainer = styled.div`
height: 100%;
@@ -54,6 +54,7 @@ export const CoreObjectIndexPageLayout = ({
onFetchNextPage,
children,
}: CoreObjectIndexPageLayoutProps) => {
+ const { t } = useLingui();
return (
<>
<PageTitle title={labelPlural} />
diff --git a/packages/twenty-front/src/modules/object-core/filters/components/CoreObjectFilterAddRuleButton.tsx b/packages/twenty-front/src/modules/object-core/filters/components/CoreObjectFilterAddRuleButton.tsx
index 717775d2961..3d8c8dbdbc6 100644
--- a/packages/twenty-front/src/modules/object-core/filters/components/CoreObjectFilterAddRuleButton.tsx
+++ b/packages/twenty-front/src/modules/object-core/filters/components/CoreObjectFilterAddRuleButton.tsx
@@ -1,9 +1,9 @@
-import { t } from '@lingui/core/macro';
import { type StepFilterGroup } from 'twenty-shared/types';
import { IconPlus } from 'twenty-ui/icon';
import { CommandMenuButton } from '@/command-menu/components/CommandMenuButton';
import { useAddStepFilterToGroup } from '@/workflow/workflow-steps/filters/hooks/useAddStepFilterToGroup';
+import { useLingui } from '@lingui/react/macro';
type CoreObjectFilterAddRuleButtonProps = {
stepFilterGroup: StepFilterGroup;
@@ -12,6 +12,7 @@ type CoreObjectFilterAddRuleButtonProps = {
export const CoreObjectFilterAddRuleButton = ({
stepFilterGroup,
}: CoreObjectFilterAddRuleButtonProps) => {
+ const { t } = useLingui();
const { addStepFilterToGroup } = useAddStepFilterToGroup({
stepFilterGroup,
});
diff --git a/packages/twenty-front/src/modules/object-core/filters/components/CoreObjectFiltersBuilder.tsx b/packages/twenty-front/src/modules/object-core/filters/components/CoreObjectFiltersBuilder.tsx
index 15093f691bc..6b0d03fd48e 100644
--- a/packages/twenty-front/src/modules/object-core/filters/components/CoreObjectFiltersBuilder.tsx
+++ b/packages/twenty-front/src/modules/object-core/filters/components/CoreObjectFiltersBuilder.tsx
@@ -1,6 +1,5 @@
import { InputLabel } from '@/ui/input/components/internal/InputLabel/InputLabel';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type StepFilter } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
@@ -18,6 +17,7 @@ import { WorkflowStepFilterContext } from '@/workflow/workflow-steps/filters/sta
import { rootLevelStepFilterGroupComponentSelector } from '@/workflow/workflow-steps/filters/states/rootLevelStepFilterGroupComponentSelector';
import { type FilterSettings } from '@/workflow/workflow-steps/filters/types/FilterSettings';
import { isStepFilterGroupChildAStepFilterGroup } from '@/workflow/workflow-steps/filters/utils/isStepFilterGroupChildAStepFilterGroup';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
align-items: start;
@@ -51,6 +51,7 @@ const CoreObjectFiltersBuilderConditions = ({
}: {
filterFields: CoreObjectFilterField[];
}) => {
+ const { t } = useLingui();
const rootStepFilterGroup = useAtomComponentSelectorValue(
rootLevelStepFilterGroupComponentSelector,
);
diff --git a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowEditor.tsx b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowEditor.tsx
index 47eddf69726..1866b3d0789 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowEditor.tsx
+++ b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowEditor.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { useCallback } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -13,6 +12,7 @@ import { WorkflowDiagramCanvasEditable } from '@/workflow/workflow-diagram/compo
import { WorkflowDiagramEffect } from '@/workflow/workflow-diagram/components/WorkflowDiagramEffect';
import { WorkflowVisualizerEffect } from '@/workflow/workflow-diagram/components/WorkflowVisualizerEffect';
import { WorkflowVisualizerComponentInstanceContext } from '@/workflow/workflow-diagram/states/contexts/WorkflowVisualizerComponentInstanceContext';
+import { useLingui } from '@lingui/react/macro';
export const CoreWorkflowEditor = ({
coreWorkflowId,
@@ -23,6 +23,7 @@ export const CoreWorkflowEditor = ({
coreWorkflowVersionId: string;
readonly: boolean;
}) => {
+ const { t } = useLingui();
const { coreWorkflowVersion, loading, error, refetchCoreWorkflowVersion } =
useCoreWorkflowVersion(coreWorkflowVersionId);
diff --git a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowVisibilityCell.tsx b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowVisibilityCell.tsx
index 85a180ef1ce..0689145c2b3 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowVisibilityCell.tsx
+++ b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowVisibilityCell.tsx
@@ -1,9 +1,9 @@
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { Tag } from 'twenty-ui/primitives/data-display';
import { type WorkflowVisibility } from '~/generated/graphql';
import { CORE_WORKFLOW_VISIBILITY_OPTIONS } from '@/object-core/workflows/constants/CoreWorkflowVisibilityOptions';
+import { useLingui } from '@lingui/react/macro';
type CoreWorkflowVisibilityCellProps = {
visibility: WorkflowVisibility;
@@ -12,6 +12,7 @@ type CoreWorkflowVisibilityCellProps = {
export const CoreWorkflowVisibilityCell = ({
visibility,
}: CoreWorkflowVisibilityCellProps) => {
+ const { t } = useLingui();
const visibilityOption = CORE_WORKFLOW_VISIBILITY_OPTIONS.find(
({ value }) => value === visibility,
);
diff --git a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowsPermissionGate.tsx b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowsPermissionGate.tsx
index 37357ae5ba1..7d7bc9d16f8 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowsPermissionGate.tsx
+++ b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowsPermissionGate.tsx
@@ -1,9 +1,9 @@
-import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { PermissionFlagType } from 'twenty-shared/constants';
import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
import { WorkspaceRouteUnavailable } from '@/ui/layout/page/components/WorkspaceRouteUnavailable';
+import { useLingui } from '@lingui/react/macro';
type CoreWorkflowsPermissionGateProps = {
children: ReactNode;
@@ -12,6 +12,7 @@ type CoreWorkflowsPermissionGateProps = {
export const CoreWorkflowsPermissionGate = ({
children,
}: CoreWorkflowsPermissionGateProps) => {
+ const { t } = useLingui();
const canManageWorkflows = useHasPermissionFlag(PermissionFlagType.WORKFLOWS);
if (!canManageWorkflows) {
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useDeleteSelectedCoreWorkflows.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useDeleteSelectedCoreWorkflows.ts
index 9f6b45c959b..e76da6f4553 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/hooks/useDeleteSelectedCoreWorkflows.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useDeleteSelectedCoreWorkflows.ts
@@ -1,5 +1,4 @@
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { dispatchObjectRecordOperationBrowserEvent } from '@/browser-event/utils/dispatchObjectRecordOperationBrowserEvent';
@@ -23,8 +22,10 @@ import {
type DeleteCoreWorkflowsMutationVariables,
} from '~/generated/graphql';
import { logError } from '~/utils/logError';
+import { useLingui } from '@lingui/react/macro';
export const useDeleteSelectedCoreWorkflows = () => {
+ const { t } = useLingui();
const apolloCoreClient = useApolloCoreClient();
const { objectMetadataItem } = useObjectMetadataItem({
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useRenameCoreWorkflow.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useRenameCoreWorkflow.ts
index 4a34b5a675f..5dffd03315c 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/hooks/useRenameCoreWorkflow.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useRenameCoreWorkflow.ts
@@ -1,10 +1,10 @@
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useToast } from 'twenty-ui/components/feedback';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { invalidateCoreWorkflowQueries } from '@/object-core/workflows/utils/invalidateCoreWorkflowQueries';
import { UpdateCoreWorkflowDocument } from '~/generated/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useRenameCoreWorkflow = ({
coreWorkflowId,
@@ -13,6 +13,7 @@ export const useRenameCoreWorkflow = ({
coreWorkflowId: string;
currentName: string | undefined | null;
}) => {
+ const { t } = useLingui();
const client = useApolloCoreClient();
const [updateWorkflow] = useMutation(UpdateCoreWorkflowDocument, { client });
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneFieldMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneFieldMetadataItem.ts
index 7056b7b3db1..83213773edc 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneFieldMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneFieldMetadataItem.ts
@@ -9,12 +9,13 @@ import { useUpdateMetadataStoreDraft } from '@/metadata-store/hooks/useUpdateMet
import { type FlatFieldMetadataItem } from '@/metadata-store/types/FlatFieldMetadataItem';
import { type MetadataRequestResult } from '@/object-metadata/types/MetadataRequestResult';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
-import { t } from '@lingui/core/macro';
import { CrudOperationType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
+import { useLingui } from '@lingui/react/macro';
export const useCreateOneFieldMetadataItem = () => {
+ const { t } = useLingui();
const [createOneFieldMetadataItemMutation] = useMutation(
CreateOneFieldMetadataItemDocument,
);
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneIndexMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneIndexMetadataItem.ts
index d99ba5e00b3..e93aab583ea 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneIndexMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneIndexMetadataItem.ts
@@ -1,6 +1,5 @@
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { CrudOperationType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -14,8 +13,10 @@ import {
type CreateIndexInput,
CreateOneIndexMetadataItemDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useCreateOneIndexMetadataItem = () => {
+ const { t } = useLingui();
const [createOneIndexMetadataItemMutation] = useMutation(
CreateOneIndexMetadataItemDocument,
);
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneObjectMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneObjectMetadataItem.ts
index ba0a95a6b0d..3ab08b7a49f 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneObjectMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneObjectMetadataItem.ts
@@ -16,12 +16,13 @@ import { splitViewWithRelated } from '@/metadata-store/utils/splitViewWithRelate
import { type MetadataRequestResult } from '@/object-metadata/types/MetadataRequestResult';
import { useLoadCurrentUser } from '@/users/hooks/useLoadCurrentUser';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
-import { t } from '@lingui/core/macro';
import { CrudOperationType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
+import { useLingui } from '@lingui/react/macro';
export const useCreateOneObjectMetadataItem = () => {
+ const { t } = useLingui();
const [createOneObjectMetadataItemMutation] = useMutation(
CreateOneObjectMetadataItemDocument,
);
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneFieldMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneFieldMetadataItem.ts
index cb75f0f9ade..1a5860c6e0c 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneFieldMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneFieldMetadataItem.ts
@@ -11,11 +11,12 @@ import { AggregateOperations } from '@/object-record/record-table/constants/Aggr
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
-import { t } from '@lingui/core/macro';
import { CrudOperationType } from 'twenty-shared/types';
import { useToast } from 'twenty-ui/components/feedback';
+import { useLingui } from '@lingui/react/macro';
export const useDeleteOneFieldMetadataItem = () => {
+ const { t } = useLingui();
const [deleteOneFieldMetadataItemMutation] = useMutation(
DeleteOneFieldMetadataItemDocument,
);
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneIndexMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneIndexMetadataItem.ts
index 01e8511a68b..fb2a6019ace 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneIndexMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneIndexMetadataItem.ts
@@ -1,6 +1,5 @@
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { CrudOperationType } from 'twenty-shared/types';
import { useMetadataErrorHandler } from '@/metadata-error-handler/hooks/useMetadataErrorHandler';
@@ -8,8 +7,10 @@ import { useUpdateMetadataStoreDraft } from '@/metadata-store/hooks/useUpdateMet
import { type MetadataRequestResult } from '@/object-metadata/types/MetadataRequestResult';
import { useToast } from 'twenty-ui/components/feedback';
import { DeleteOneIndexMetadataItemDocument } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useDeleteOneIndexMetadataItem = () => {
+ const { t } = useLingui();
const [deleteOneIndexMetadataItemMutation] = useMutation(
DeleteOneIndexMetadataItemDocument,
);
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneObjectMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneObjectMetadataItem.ts
index 57e7f69e9fc..9117cfcb0c9 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneObjectMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneObjectMetadataItem.ts
@@ -5,11 +5,12 @@ import { useMetadataErrorHandler } from '@/metadata-error-handler/hooks/useMetad
import { useInvalidateMetadataStore } from '@/metadata-store/hooks/useInvalidateMetadataStore';
import { type MetadataRequestResult } from '@/object-metadata/types/MetadataRequestResult';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
-import { t } from '@lingui/core/macro';
import { CrudOperationType } from 'twenty-shared/types';
import { useToast } from 'twenty-ui/components/feedback';
+import { useLingui } from '@lingui/react/macro';
export const useDeleteOneObjectMetadataItem = () => {
+ const { t } = useLingui();
const [deleteOneObjectMetadataItemMutation] = useMutation(
DeleteOneObjectMetadataItemDocument,
);
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneFieldMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneFieldMetadataItem.ts
index 5c7eaf3ab12..1861ec69e52 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneFieldMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneFieldMetadataItem.ts
@@ -11,13 +11,14 @@ import { lastFieldMetadataItemUpdateState } from '@/object-metadata/states/lastF
import { type MetadataRequestResult } from '@/object-metadata/types/MetadataRequestResult';
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
-import { t } from '@lingui/core/macro';
import { CrudOperationType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
import { v4 as uuidv4 } from 'uuid';
+import { useLingui } from '@lingui/react/macro';
export const useUpdateOneFieldMetadataItem = () => {
+ const { t } = useLingui();
const [updateOneFieldMetadataItemMutation] = useMutation(
UpdateOneFieldMetadataItemDocument,
);
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneObjectMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneObjectMetadataItem.ts
index cd9b0a279e9..2f07c5cea2f 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneObjectMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneObjectMetadataItem.ts
@@ -10,13 +10,14 @@ import { useUpdateMetadataStoreDraft } from '@/metadata-store/hooks/useUpdateMet
import { type FlatObjectMetadataItem } from '@/metadata-store/types/FlatObjectMetadataItem';
import { type MetadataRequestResult } from '@/object-metadata/types/MetadataRequestResult';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
-import { t } from '@lingui/core/macro';
import { CrudOperationType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
+import { useLingui } from '@lingui/react/macro';
// TODO: Slice the Apollo store synchronously in the update function instead of subscribing, so we can use update after read in the same function call
export const useUpdateOneObjectMetadataItem = () => {
+ const { t } = useLingui();
const [updateOneObjectMetadataItemMutation, { loading }] = useMutation(
UpdateOneObjectMetadataItemDocument,
);
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterAddFilterRuleSelect.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterAddFilterRuleSelect.tsx
index ee532687b2a..5887ad5ff6a 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterAddFilterRuleSelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterAddFilterRuleSelect.tsx
@@ -14,13 +14,13 @@ import { getDefaultSubFieldNameForCompositeFilterableFieldType } from '@/object-
import { Dropdown } from 'twenty-ui/components/navigation';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { RecordFilterGroupLogicalOperator } from 'twenty-shared/types';
import { getFilterTypeFromFieldType, isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
import { IconLibraryPlus, IconPlus } from 'twenty-ui/icon';
import { v4 } from 'uuid';
+import { useLingui } from '@lingui/react/macro';
type AdvancedFilterAddFilterRuleSelectProps = {
recordFilterGroup: RecordFilterGroup;
@@ -29,6 +29,7 @@ type AdvancedFilterAddFilterRuleSelectProps = {
export const AdvancedFilterAddFilterRuleSelect = ({
recordFilterGroup,
}: AdvancedFilterAddFilterRuleSelectProps) => {
+ const { t } = useLingui();
const dropdownId = getAdvancedFilterAddFilterRuleSelectDropdownId(
recordFilterGroup.id,
);
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterCompositeSubFieldSelectMenu.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterCompositeSubFieldSelectMenu.tsx
index 4a72463aea9..2affee17230 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterCompositeSubFieldSelectMenu.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterCompositeSubFieldSelectMenu.tsx
@@ -8,11 +8,11 @@ import { isCompositeTypeNonFilterableByAnySubField } from '@/object-record/recor
import { SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS } from '@/settings/data-model/constants/SettingsCompositeFieldTypeConfigs';
import { type CompositeFieldSubFieldName } from '@/settings/data-model/types/CompositeFieldSubFieldName';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { t } from '@lingui/core/macro';
import { getFilterTypeFromFieldType } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
import { useIcons } from 'twenty-ui/icon/provider';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
+import { useLingui } from '@lingui/react/macro';
type AdvancedFilterCompositeSubFieldSelectMenuProps = {
recordFilterId: string;
@@ -23,6 +23,7 @@ export const AdvancedFilterCompositeSubFieldSelectMenu = ({
recordFilterId,
fieldMetadataItem,
}: AdvancedFilterCompositeSubFieldSelectMenuProps) => {
+ const { t } = useLingui();
const { getIcon } = useIcons();
const { applyAdvancedFilterCompositeSubField } =
useApplyAdvancedFilterCompositeSubField();
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterDropdownTextInput.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterDropdownTextInput.tsx
index a3fedf0e8fe..36cca2c70c0 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterDropdownTextInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterDropdownTextInput.tsx
@@ -1,7 +1,7 @@
import { useApplyObjectFilterDropdownFilterValue } from '@/object-record/object-filter-dropdown/hooks/useApplyObjectFilterDropdownFilterValue';
import { type RecordFilter } from '@/object-record/record-filter/types/RecordFilter';
import { TextInput } from '@/ui/input/components/TextInput';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type AdvancedFilterDropdownTextInputProps = {
recordFilter: RecordFilter;
@@ -10,6 +10,7 @@ type AdvancedFilterDropdownTextInputProps = {
export const AdvancedFilterDropdownTextInput = ({
recordFilter,
}: AdvancedFilterDropdownTextInputProps) => {
+ const { t } = useLingui();
const { applyObjectFilterDropdownFilterValue } =
useApplyObjectFilterDropdownFilterValue();
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterFieldSelectDropdownButton.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterFieldSelectDropdownButton.tsx
index 6ba192a970c..9ecc9a6385a 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterFieldSelectDropdownButton.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterFieldSelectDropdownButton.tsx
@@ -6,8 +6,8 @@ import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Dropdown } from 'twenty-ui/components/navigation';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
flex: 2;
@@ -20,6 +20,7 @@ type AdvancedFilterFieldSelectDropdownButtonProps = {
export const AdvancedFilterFieldSelectDropdownButton = ({
recordFilterId,
}: AdvancedFilterFieldSelectDropdownButtonProps) => {
+ const { t } = useLingui();
const { advancedFilterFieldSelectDropdownId } =
useAdvancedFilterFieldSelectDropdown(recordFilterId);
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterLogicalOperatorCell.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterLogicalOperatorCell.tsx
index 8fa8100c080..82c0af5c64c 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterLogicalOperatorCell.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterLogicalOperatorCell.tsx
@@ -2,9 +2,9 @@ import { AdvancedFilterLogicalOperatorDropdown } from '@/object-record/advanced-
import { type RecordFilterGroup } from '@/object-record/record-filter-group/types/RecordFilterGroup';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { capitalize } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledText = styled.div`
align-items: center;
@@ -30,6 +30,7 @@ export const AdvancedFilterLogicalOperatorCell = ({
index,
recordFilterGroup,
}: AdvancedFilterLogicalOperatorCellProps) => {
+ const { t } = useLingui();
return (
<StyledContainer>
{index === 0 ? (
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterGroupOptionsDropdown.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterGroupOptionsDropdown.tsx
index 0dc5b5a5241..661d39045aa 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterGroupOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterGroupOptionsDropdown.tsx
@@ -8,8 +8,8 @@ import { IconButton } from 'twenty-ui/components/input';
import { Dropdown } from 'twenty-ui/components/navigation';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
-import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type AdvancedFilterRecordFilterGroupOptionsDropdownProps = {
recordFilterGroupId: string;
@@ -18,6 +18,7 @@ type AdvancedFilterRecordFilterGroupOptionsDropdownProps = {
export const AdvancedFilterRecordFilterGroupOptionsDropdown = ({
recordFilterGroupId,
}: AdvancedFilterRecordFilterGroupOptionsDropdownProps) => {
+ const { t } = useLingui();
const dropdownId = `advanced-filter-record-filter-group-options-${recordFilterGroupId}`;
const { removeRecordFilter } = useRemoveRecordFilter();
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOperandSelect.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOperandSelect.tsx
index 741816dc41f..5a4171b3964 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOperandSelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOperandSelect.tsx
@@ -7,8 +7,8 @@ import { useUserTimezone } from '@/ui/input/components/internal/date/hooks/useUs
import { SelectControl } from '@/ui/input/components/SelectControl';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
width: 100px;
@@ -21,6 +21,7 @@ type AdvancedFilterRecordFilterOperandSelectProps = {
export const AdvancedFilterRecordFilterOperandSelect = ({
recordFilterId,
}: AdvancedFilterRecordFilterOperandSelectProps) => {
+ const { t } = useLingui();
const currentRecordFilters = useAtomComponentStateValue(
currentRecordFiltersComponentState,
);
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOperandSelectContent.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOperandSelectContent.tsx
index c6475b080ee..70bdf8fad53 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOperandSelectContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOperandSelectContent.tsx
@@ -12,11 +12,11 @@ import { SelectControl } from '@/ui/input/components/SelectControl';
import { Dropdown } from 'twenty-ui/components/navigation';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
import { type ViewFilterOperand } from 'twenty-shared/types';
+import { useLingui } from '@lingui/react/macro';
type AdvancedFilterRecordFilterOperandSelectContentProps = {
recordFilterId: string;
@@ -29,6 +29,7 @@ export const AdvancedFilterRecordFilterOperandSelectContent = ({
filter,
operandsForFilterType,
}: AdvancedFilterRecordFilterOperandSelectContentProps) => {
+ const { t } = useLingui();
const dropdownId = `advanced-filter-view-filter-operand-${recordFilterId}`;
const { isWorkflowFindRecords } = useContext(AdvancedFilterContext);
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOptionsDropdown.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOptionsDropdown.tsx
index ffa2c204767..7c3cf067f44 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOptionsDropdown.tsx
@@ -11,9 +11,9 @@ import { Dropdown } from 'twenty-ui/components/navigation';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type AdvancedFilterRecordFilterOptionsDropdownProps = {
recordFilterId: string;
@@ -22,6 +22,7 @@ type AdvancedFilterRecordFilterOptionsDropdownProps = {
export const AdvancedFilterRecordFilterOptionsDropdown = ({
recordFilterId,
}: AdvancedFilterRecordFilterOptionsDropdownProps) => {
+ const { t } = useLingui();
const dropdownId = `advanced-filter-record-filter-options-${recordFilterId}`;
const { removeRecordFilter } = useRemoveRecordFilter();
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRelationTargetFieldSelectMenu.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRelationTargetFieldSelectMenu.tsx
index 90eac19f6ce..1ecd1e61b89 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRelationTargetFieldSelectMenu.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRelationTargetFieldSelectMenu.tsx
@@ -6,11 +6,11 @@ import { useApplyAdvancedFilterSourceField } from '@/object-record/advanced-filt
import { usePushFocusForLeafFieldValuePicker } from '@/object-record/advanced-filter/hooks/usePushFocusForLeafFieldValuePicker';
import { useFilterableFieldMetadataItems } from '@/object-record/record-filter/hooks/useFilterableFieldMetadataItems';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { t } from '@lingui/core/macro';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { Dropdown } from 'twenty-ui/components/navigation';
import { IconUserCircle } from 'twenty-ui/icon';
import { useIcons } from 'twenty-ui/icon/provider';
+import { useLingui } from '@lingui/react/macro';
type AdvancedFilterRelationTargetFieldSelectMenuProps = {
recordFilterId: string;
@@ -21,6 +21,7 @@ export const AdvancedFilterRelationTargetFieldSelectMenu = ({
recordFilterId,
sourceFieldMetadataItem,
}: AdvancedFilterRelationTargetFieldSelectMenuProps) => {
+ const { t } = useLingui();
const { getIcon } = useIcons();
const { applyAdvancedFilterRelationTargetField } =
useApplyAdvancedFilterRelationTargetField();
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterValueInputDropdownButtonClickableSelect.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterValueInputDropdownButtonClickableSelect.tsx
index e328ee1196d..77882db3c35 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterValueInputDropdownButtonClickableSelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterValueInputDropdownButtonClickableSelect.tsx
@@ -10,9 +10,9 @@ import { styled } from '@linaria/react';
import { useFieldMetadataItemById } from '@/object-metadata/hooks/useFieldMetadataItemById';
import { useGetRecordFilterDisplayValue } from '@/object-record/record-filter/hooks/useGetRecordFilterDisplayValue';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
// TODO: factorize this with https://github.com/twentyhq/core-team-issues/issues/752
const StyledControlContainer = styled.div`
@@ -38,6 +38,7 @@ type AdvancedFilterValueInputDropdownButtonClickableSelectProps = {
export const AdvancedFilterValueInputDropdownButtonClickableSelect = ({
recordFilterId,
}: AdvancedFilterValueInputDropdownButtonClickableSelectProps) => {
+ const { t } = useLingui();
const currentRecordFilters = useAtomComponentStateValue(
currentRecordFiltersComponentState,
);
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/side-panel/components/AdvancedFilterSidePanelCreateRootFilterButton.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/side-panel/components/AdvancedFilterSidePanelCreateRootFilterButton.tsx
index 9d6accc9883..0ce24a59006 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/side-panel/components/AdvancedFilterSidePanelCreateRootFilterButton.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/side-panel/components/AdvancedFilterSidePanelCreateRootFilterButton.tsx
@@ -9,7 +9,6 @@ import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/
import { useSetAtomComponentFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentFamilyState';
import { hasInitializedCurrentRecordFiltersComponentFamilyState } from '@/views/states/hasInitializedCurrentRecordFiltersComponentFamilyState';
import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilySelectorValue';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { RecordFilterGroupLogicalOperator } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -17,12 +16,14 @@ import { doNotTranslate } from 'twenty-shared/i18n';
import { IconFilter } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { v4 } from 'uuid';
+import { useLingui } from '@lingui/react/macro';
export const AdvancedFilterSidePanelCreateRootFilterButton = ({
objectMetadataItem,
}: {
objectMetadataItem: EnrichedObjectMetadataItem;
}) => {
+ const { t } = useLingui();
const { readonly } = useContext(AdvancedFilterContext);
const rootRecordFilterGroup = useAtomComponentSelectorValue(
rootLevelRecordFilterGroupComponentSelector,
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/side-panel/components/AdvancedFilterSidePanelLogicalOperatorCell.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/side-panel/components/AdvancedFilterSidePanelLogicalOperatorCell.tsx
index 95838dd4e8e..76ae6daab36 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/side-panel/components/AdvancedFilterSidePanelLogicalOperatorCell.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/side-panel/components/AdvancedFilterSidePanelLogicalOperatorCell.tsx
@@ -7,9 +7,9 @@ import { Select } from '@/ui/input/components/Select';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledText = styled.div`
align-items: center;
@@ -34,6 +34,7 @@ export const AdvancedFilterSidePanelLogicalOperatorCell = ({
index,
recordFilterGroup,
}: AdvancedFilterSidePanelLogicalOperatorCellProps) => {
+ const { t } = useLingui();
const { readonly } = useContext(AdvancedFilterContext);
const logicalOperatorOptions = ADVANCED_FILTER_LOGICAL_OPERATOR_OPTIONS.map(
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/side-panel/components/AdvancedFilterSidePanelRecordFilterOperandSelect.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/side-panel/components/AdvancedFilterSidePanelRecordFilterOperandSelect.tsx
index e50a39b6368..0712da23a7d 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/side-panel/components/AdvancedFilterSidePanelRecordFilterOperandSelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/side-panel/components/AdvancedFilterSidePanelRecordFilterOperandSelect.tsx
@@ -5,10 +5,10 @@ import { currentRecordFiltersComponentState } from '@/object-record/record-filte
import { getRecordFilterOperands } from '@/object-record/record-filter/utils/getRecordFilterOperands';
import { SelectControl } from '@/ui/input/components/SelectControl';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
type AdvancedFilterSidePanelRecordFilterOperandSelectProps = {
recordFilterId: string;
@@ -17,6 +17,7 @@ type AdvancedFilterSidePanelRecordFilterOperandSelectProps = {
export const AdvancedFilterSidePanelRecordFilterOperandSelect = ({
recordFilterId,
}: AdvancedFilterSidePanelRecordFilterOperandSelectProps) => {
+ const { t } = useLingui();
const { readonly, isWorkflowFindRecords } = useContext(AdvancedFilterContext);
const currentRecordFilters = useAtomComponentStateValue(
currentRecordFiltersComponentState,
diff --git a/packages/twenty-front/src/modules/object-record/hooks/useBatchCreateManyRecords.ts b/packages/twenty-front/src/modules/object-record/hooks/useBatchCreateManyRecords.ts
index 15ca52d2896..e08a75af8cc 100644
--- a/packages/twenty-front/src/modules/object-record/hooks/useBatchCreateManyRecords.ts
+++ b/packages/twenty-front/src/modules/object-record/hooks/useBatchCreateManyRecords.ts
@@ -9,8 +9,8 @@ import {
import { useRefetchAggregateQueries } from '@/object-record/hooks/useRefetchAggregateQueries';
import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
-import { t } from '@lingui/core/macro';
import { useToast } from 'twenty-ui/components/feedback';
+import { useLingui } from '@lingui/react/macro';
export const useBatchCreateManyRecords = <
CreatedObjectRecord extends ObjectRecord = ObjectRecord,
@@ -27,6 +27,7 @@ export const useBatchCreateManyRecords = <
setBatchedRecordsCount?: (count: number) => void;
abortController?: AbortController;
}) => {
+ const { t } = useLingui();
const { createManyRecords } = useCreateManyRecords({
objectNameSingular,
recordGqlFields,
diff --git a/packages/twenty-front/src/modules/object-record/hooks/useCreateOneRecord.ts b/packages/twenty-front/src/modules/object-record/hooks/useCreateOneRecord.ts
index 3b408f99be8..4f2a90cae4e 100644
--- a/packages/twenty-front/src/modules/object-record/hooks/useCreateOneRecord.ts
+++ b/packages/twenty-front/src/modules/object-record/hooks/useCreateOneRecord.ts
@@ -1,7 +1,5 @@
import { useState } from 'react';
import { v4 } from 'uuid';
-import { t } from '@lingui/core/macro';
-
import { triggerCreateRecordsOptimisticEffect } from '@/apollo/optimistic-effect/utils/triggerCreateRecordsOptimisticEffect';
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
@@ -31,6 +29,7 @@ import { getCreateOneRecordMutationResponseField } from '@/object-record/utils/g
import { sanitizeRecordInput } from '@/object-record/utils/sanitizeRecordInput';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { CustomError, isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
type useCreateOneRecordProps = {
objectNameSingular: string;
@@ -47,6 +46,7 @@ export const useCreateOneRecord = <
skipPostOptimisticEffect = false,
shouldMatchRootQueryFilter,
}: useCreateOneRecordProps) => {
+ const { t } = useLingui();
const { upsertRecordsInStore } = useUpsertRecordsInStore();
const apolloCoreClient = useApolloCoreClient();
const [loading, setLoading] = useState(false);
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
index aa852b238ce..5478d04178d 100644
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx
@@ -10,12 +10,12 @@ import { type SelectableItem } from '@/object-record/select/types/SelectableItem
import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { type RelationFilterValue } from '@/views/view-filter-value/types/RelationFilterValue';
-import { t } from '@lingui/core/macro';
import {
arrayOfUuidOrVariableSchema,
jsonRelationFilterValueSchema,
} from 'twenty-shared/utils';
import { IconUserCircle } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const EMPTY_ACTOR_FILTER_VALUE: string = JSON.stringify({
isCurrentWorkspaceMemberSelected: false,
@@ -31,6 +31,7 @@ type ObjectFilterDropdownActorSelectProps = {
export const ObjectFilterDropdownActorSelect = ({
dropdownId,
}: ObjectFilterDropdownActorSelectProps) => {
+ const { t } = useLingui();
const { objectFilterDropdownFilterValue } =
useObjectFilterDropdownFilterValue();
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownBooleanSelect.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownBooleanSelect.tsx
index 64a4e94e0ca..7327774065c 100644
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownBooleanSelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownBooleanSelect.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { useApplyObjectFilterDropdownFilterValue } from '@/object-record/object-filter-dropdown/hooks/useApplyObjectFilterDropdownFilterValue';
@@ -13,6 +12,7 @@ import { SelectableList } from '@/ui/layout/selectable-list/components/Selectabl
import { ObjectFilterDropdownComponentInstanceContext } from '@/object-record/object-filter-dropdown/states/contexts/ObjectFilterDropdownComponentInstanceContext';
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { IconCheck } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
const StyledBooleanSelectContainer = styled.div<{ selected?: boolean }>`
align-items: center;
@@ -34,6 +34,7 @@ const StyledIconCheckContainer = styled.div`
`;
export const ObjectFilterDropdownBooleanSelect = () => {
+ const { t } = useLingui();
const objectFilterDropdownComponentInstanceId =
useAvailableComponentInstanceIdOrThrow(
ObjectFilterDropdownComponentInstanceContext,
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownInnerSelectOperandDropdown.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownInnerSelectOperandDropdown.tsx
index b64db44a44b..24f77837ff0 100644
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownInnerSelectOperandDropdown.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownInnerSelectOperandDropdown.tsx
@@ -19,11 +19,12 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { ObjectFilterDropdownComponentInstanceContext } from '@/object-record/object-filter-dropdown/states/contexts/ObjectFilterDropdownComponentInstanceContext';
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
-import { t } from '@lingui/core/macro';
import { getFilterTypeFromFieldType, isDefined } from 'twenty-shared/utils';
import { type SelectOption } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
export const ObjectFilterDropdownInnerSelectOperandDropdown = () => {
+ const { t } = useLingui();
const objectFilterDropdownComponentInstanceId =
useAvailableComponentInstanceIdOrThrow(
ObjectFilterDropdownComponentInstanceContext,
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownOptionSelect.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownOptionSelect.tsx
index 77ce455db04..a6f87971fef 100644
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownOptionSelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownOptionSelect.tsx
@@ -17,7 +17,6 @@ import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/com
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilySelectorValue';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useEffect, useMemo, useState } from 'react';
import { Key } from 'ts-key-enum';
@@ -27,6 +26,7 @@ import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { Tag } from 'twenty-ui/primitives/data-display';
import { ListItem } from 'twenty-ui/primitives/navigation';
import { z } from 'zod';
+import { useLingui } from '@lingui/react/macro';
export const EMPTY_FILTER_VALUE = '';
@@ -39,6 +39,7 @@ export const ObjectFilterDropdownOptionSelect = ({
}: {
focusId: string;
}) => {
+ const { t } = useLingui();
const fieldMetadataItemUsedInDropdown = useAtomComponentSelectorValue(
fieldMetadataItemUsedInDropdownComponentSelector,
);
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownRecordSelect.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownRecordSelect.tsx
index 5d7eba3e904..caccace5554 100644
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownRecordSelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownRecordSelect.tsx
@@ -18,7 +18,6 @@ import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownM
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { type RelationFilterValue } from '@/views/view-filter-value/types/RelationFilterValue';
-import { t } from '@lingui/core/macro';
import {
arrayOfUuidOrVariableSchema,
isDefined,
@@ -28,6 +27,7 @@ import { doNotTranslate } from 'twenty-shared/i18n';
import { IconUserCircle } from 'twenty-ui/icon';
import { allowRequestsToTwentyIconsState } from '@/client-config/states/allowRequestsToTwentyIcons';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import { useLingui } from '@lingui/react/macro';
export const EMPTY_FILTER_VALUE: string = JSON.stringify({
isCurrentWorkspaceMemberSelected: false,
@@ -54,6 +54,7 @@ const ObjectFilterDropdownRecordSelectContent = ({
recordFilterId,
dropdownId,
}: ObjectFilterDropdownRecordSelectContentProps) => {
+ const { t } = useLingui();
const fieldMetadataItemUsedInFilterDropdown = useAtomComponentSelectorValue(
fieldMetadataItemUsedInDropdownComponentSelector,
);
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarViewContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarViewContent.tsx
index 4ab6daa4db5..d6c2f0ec4ae 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarViewContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarViewContent.tsx
@@ -12,7 +12,6 @@ import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { useUpdateCurrentView } from '@/views/hooks/useUpdateCurrentView';
-import { t } from '@lingui/core/macro';
import {
IconCalendarEvent,
IconCalendarMonth,
@@ -22,10 +21,12 @@ import {
} from 'twenty-ui/icon';
import { Badge } from 'twenty-ui/primitives/data-display';
import { ViewCalendarLayout } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const RECORD_CALENDAR_TIMELINE_VIEW_ID = 'record-calendar-timeline-view';
export const ObjectOptionsDropdownCalendarViewContent = () => {
+ const { t } = useLingui();
const { resetContent, dropdownId } = useObjectOptionsDropdown();
const recordIndexCalendarLayout = useAtomComponentStateValue(
recordIndexCalendarLayoutComponentState,
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupLoadLimitContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupLoadLimitContent.tsx
index 5c3adcfd5bd..89d45051ed8 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupLoadLimitContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupLoadLimitContent.tsx
@@ -10,11 +10,12 @@ import { SelectableList } from '@/ui/layout/selectable-list/components/Selectabl
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { VIEW_GROUP_LOAD_LIMIT_OPTIONS } from 'twenty-shared/constants';
import { IconChevronLeft } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const ObjectOptionsDropdownRecordGroupLoadLimitContent = () => {
+ const { t } = useLingui();
const { onContentChange, dropdownId } = useObjectOptionsDropdown();
const recordIndexGroupLoadLimit = useAtomComponentStateValue(
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupSortContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupSortContent.tsx
index dac875f9ec4..8109f138f1b 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupSortContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupSortContent.tsx
@@ -17,7 +17,6 @@ import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { useAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { useEffect } from 'react';
import { isDefined } from 'twenty-shared/utils';
import {
@@ -26,8 +25,10 @@ import {
IconSortAZ,
IconSortZA,
} from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const ObjectOptionsDropdownRecordGroupSortContent = () => {
+ const { t } = useLingui();
const { currentContentId, onContentChange, dropdownId } =
useObjectOptionsDropdown();
diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCardHeader.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCardHeader.tsx
index 4a113fb6abe..bd71364051e 100644
--- a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCardHeader.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCardHeader.tsx
@@ -2,8 +2,6 @@ import { RecordBoardContext } from '@/object-record/record-board/contexts/Record
import { RecordBoardCardContext } from '@/object-record/record-board/record-board-card/contexts/RecordBoardCardContext';
import { isRecordSelectedComponentFamilyState } from '@/object-record/record-selection/states/isRecordSelectedComponentFamilyState';
import { useToggleRecordSelection } from '@/object-record/record-selection/hooks/useToggleRecordSelection';
-import { t } from '@lingui/core/macro';
-
import { RecordChip } from '@/object-record/components/RecordChip';
import { useActiveRecordBoardCard } from '@/object-record/record-board/hooks/useActiveRecordBoardCard';
import { useFocusedRecordBoardCard } from '@/object-record/record-board/hooks/useFocusedRecordBoardCard';
@@ -26,6 +24,7 @@ import { IconEye, IconEyeOff } from 'twenty-ui/icon';
import { Checkbox } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
import { useIsMobile, useIsTouchDevice } from 'twenty-ui/utilities';
+import { useLingui } from '@lingui/react/macro';
const StyledCompactIconContainer = styled.div`
align-items: center;
@@ -45,6 +44,7 @@ const StyledRecordChipContainer = styled.div`
`;
export const RecordBoardCardHeader = () => {
+ const { t } = useLingui();
const { recordId } = useContext(RecordBoardCardContext);
const { objectMetadataItem, recordBoardId } = useContext(RecordBoardContext);
diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx
index 2d39e8309c1..f41fdd06304 100644
--- a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { themeCssVariables } from 'twenty-ui/theme';
@@ -35,6 +34,7 @@ import { isDefined } from 'twenty-shared/utils';
import { LightIconButton } from 'twenty-ui/components/input';
import { Dropdown } from 'twenty-ui/components/navigation';
import { IconDotsVertical, IconPlus } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
const StyledHeader = styled.div<{ isReadOnly: boolean }>`
align-items: center;
@@ -127,6 +127,7 @@ const StyledDropdownContainer = styled.div`
`;
export const RecordBoardColumnHeader = () => {
+ const { t } = useLingui();
const { columnDefinition, columnIndex } = useContext(
RecordBoardColumnContext,
);
diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnNewRecordButton.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnNewRecordButton.tsx
index 2c3f019214a..a7ce150e231 100644
--- a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnNewRecordButton.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnNewRecordButton.tsx
@@ -9,13 +9,14 @@ import { RecordTableWidgetContext } from '@/object-record/record-table-widget/co
import { canCreateRecordsForObjectMetadataItem } from '@/object-record/utils/canCreateRecordsForObjectMetadataItem';
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { LightButton } from 'twenty-ui/components/input';
import { IconPlus } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const RecordBoardColumnNewRecordButton = () => {
+ const { t } = useLingui();
const { objectMetadataItem, selectFieldMetadataItem } =
useContext(RecordBoardContext);
diff --git a/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarAddNew.tsx b/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarAddNew.tsx
index 2d817481633..0e15fb3eb08 100644
--- a/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarAddNew.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarAddNew.tsx
@@ -11,7 +11,6 @@ import { canCreateRecordsForObjectMetadataItem } from '@/object-record/utils/can
import { useUserTimezone } from '@/ui/input/components/internal/date/hooks/useUserTimezone';
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { type Temporal } from 'temporal-polyfill';
import { FieldMetadataType } from 'twenty-shared/types';
@@ -19,6 +18,7 @@ import { isDefined } from 'twenty-shared/utils';
import { IconPlus } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledButtonContainer = styled.div`
height: auto;
@@ -33,6 +33,7 @@ type RecordCalendarAddNewProps = {
export const RecordCalendarAddNew = ({
cardDate,
}: RecordCalendarAddNewProps) => {
+ const { t } = useLingui();
const isRecordCalendarReadOnly = useAtomComponentStateValue(
isRecordCalendarReadOnlyComponentState,
);
diff --git a/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarDragDropContext.tsx b/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarDragDropContext.tsx
index 6e355f1febe..e4d5d100053 100644
--- a/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarDragDropContext.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarDragDropContext.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { useStore } from 'jotai';
import type { ReactNode } from 'react';
import { Temporal } from 'temporal-polyfill';
@@ -11,6 +10,7 @@ import { useProcessCalendarCardDrop } from '@/object-record/record-drag/hooks/us
import { useUserTimezone } from '@/ui/input/components/internal/date/hooks/useUserTimezone';
import { useAtomComponentFamilySelectorCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilySelectorCallbackState';
import { logError } from '~/utils/logError';
+import { useLingui } from '@lingui/react/macro';
type RecordCalendarDragDropContextProps = {
children: ReactNode;
@@ -19,6 +19,7 @@ type RecordCalendarDragDropContextProps = {
export const RecordCalendarDragDropContext = ({
children,
}: RecordCalendarDragDropContextProps) => {
+ const { t } = useLingui();
const store = useStore();
const { userTimezone } = useUserTimezone();
diff --git a/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarTopBar.tsx b/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarTopBar.tsx
index 7b6fd258ed6..8319a340636 100644
--- a/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarTopBar.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarTopBar.tsx
@@ -21,7 +21,6 @@ import { useAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useAtomC
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useUpdateCurrentView } from '@/views/hooks/useUpdateCurrentView';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { format } from 'date-fns';
import { Temporal } from 'temporal-polyfill';
import { type Nullable } from 'twenty-shared/types';
@@ -35,6 +34,7 @@ import { Button } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
import { ViewCalendarLayout } from '~/generated-metadata/graphql';
import { dateLocaleState } from '@/localization/states/dateLocaleState';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
align-items: center;
@@ -62,6 +62,7 @@ const StyledNavigationSection = styled.div`
`;
export const RecordCalendarTopBar = () => {
+ const { t } = useLingui();
const recordCalendarId = useAvailableComponentInstanceIdOrThrow(
RecordCalendarComponentInstanceContext,
);
diff --git a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailMorphRelationSectionDropdownOneToMany.tsx b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailMorphRelationSectionDropdownOneToMany.tsx
index 980bb449842..63a3ad117ce 100644
--- a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailMorphRelationSectionDropdownOneToMany.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailMorphRelationSectionDropdownOneToMany.tsx
@@ -1,6 +1,4 @@
import { type ReactElement, useContext } from 'react';
-import { t } from '@lingui/core/macro';
-
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { useRecordFieldsScopeContextOrThrow } from '@/object-record/record-field-list/contexts/RecordFieldsScopeContext';
import { useGetMorphRelationRelatedRecordsWithObjectNameSingular } from '@/object-record/record-field-list/record-detail-section/relation/components/hooks/useGetMorphRelationRelatedRecordsWithObjectNameSingular';
@@ -22,6 +20,7 @@ import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSe
import { FieldMetadataType } from 'twenty-shared/types';
import { CustomError, isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
type RecordDetailMorphRelationSectionDropdownOneToManyProps = {
dropdownTriggerClickableComponent: ReactElement;
@@ -30,6 +29,7 @@ type RecordDetailMorphRelationSectionDropdownOneToManyProps = {
export const RecordDetailMorphRelationSectionDropdownOneToMany = ({
dropdownTriggerClickableComponent,
}: RecordDetailMorphRelationSectionDropdownOneToManyProps) => {
+ const { t } = useLingui();
const { scopeInstanceId } = useRecordFieldsScopeContextOrThrow();
const { recordId, fieldDefinition } = useContext(FieldContext);
diff --git a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationRecordsListItem.tsx b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationRecordsListItem.tsx
index df7dff3e16f..aa8cab6b154 100644
--- a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationRecordsListItem.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationRecordsListItem.tsx
@@ -21,8 +21,7 @@ import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-import { Trans } from '@lingui/react/macro';
+import { Trans, useLingui } from '@lingui/react/macro';
import { motion } from 'framer-motion';
import { useCallback, useContext } from 'react';
import { createPortal } from 'react-dom';
@@ -77,6 +76,7 @@ export const RecordDetailRelationRecordsListItem = ({
relationObjectMetadataNameSingular,
relationFieldMetadataId,
}: RecordDetailRelationRecordsListItemProps) => {
+ const { t } = useLingui();
const { scopeInstanceId } = useRecordFieldsScopeContextOrThrow();
const {
fieldDefinition,
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAddressFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAddressFieldInput.tsx
index 0a4c4f59c08..3880bc05132 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAddressFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAddressFieldInput.tsx
@@ -6,8 +6,8 @@ import { type VariablePickerComponent } from '@/ui/input/types/VariablePickerCom
import { type FieldAddressDraftValue } from '@/object-record/record-field/ui/types/FieldInputDraftValue';
import { type FieldAddressValue } from '@/object-record/record-field/ui/types/FieldMetadata';
import { Field } from 'twenty-ui/primitives/input';
-import { t } from '@lingui/core/macro';
import { normalizeAddressFieldValueForPersist } from '@/object-record/record-field/ui/utils/normalizeAddressFieldValueForPersist';
+import { useLingui } from '@lingui/react/macro';
type FormAddressFieldInputProps = {
label?: string;
@@ -26,6 +26,7 @@ export const FormAddressFieldInput = ({
VariablePicker,
subFieldPlaceholders,
}: FormAddressFieldInputProps) => {
+ const { t } = useLingui();
const handleChange =
(field: keyof FieldAddressDraftValue) => (updatedAddressPart: string) => {
const updatedAddress = {
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCallingCodeSelectInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCallingCodeSelectInput.tsx
index 700176d6042..15f3bb554dc 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCallingCodeSelectInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCallingCodeSelectInput.tsx
@@ -4,9 +4,9 @@ import { FormSelectFieldInput } from '@/object-record/record-field/ui/form-types
import { type VariablePickerComponent } from '@/ui/input/types/VariablePickerComponent';
import { useCountries } from '@/ui/input/components/internal/hooks/useCountries';
import { isStandaloneVariableString } from 'twenty-shared/workflow';
-import { t } from '@lingui/core/macro';
import { IconCircleOff, type IconComponentProps } from 'twenty-ui/icon';
import { type SelectOption } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
export type FormCallingCodeSelectInputUpdatedValue = {
callingCode: string;
@@ -28,6 +28,7 @@ export const FormCallingCodeSelectInput = ({
readonly?: boolean;
VariablePicker?: VariablePickerComponent;
}) => {
+ const { t } = useLingui();
const countries = useCountries();
const options: SelectOption[] = useMemo(() => {
@@ -47,7 +48,7 @@ export const FormCallingCodeSelectInput = ({
},
...countryList,
];
- }, [countries]);
+ }, [countries, t]);
const defaultValue = isStandaloneVariableString(selectedCallingCode)
? selectedCallingCode
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCountrySelectInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCountrySelectInput.tsx
index e5bd38378fc..6f7e748692b 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCountrySelectInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCountrySelectInput.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { useMemo } from 'react';
import { FormSelectFieldInput } from '@/object-record/record-field/ui/form-types/components/FormSelectFieldInput';
@@ -6,6 +5,7 @@ import { type VariablePickerComponent } from '@/ui/input/types/VariablePickerCom
import { useCountries } from '@/ui/input/components/internal/hooks/useCountries';
import { IconCircleOff, type IconComponentProps } from 'twenty-ui/icon';
import { type SelectOption } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
export const FormCountrySelectInput = ({
selectedCountryName,
@@ -20,6 +20,7 @@ export const FormCountrySelectInput = ({
readonly?: boolean;
VariablePicker?: VariablePickerComponent;
}) => {
+ const { t } = useLingui();
const countries = useCountries();
const options: SelectOption[] = useMemo(() => {
@@ -39,7 +40,7 @@ export const FormCountrySelectInput = ({
},
...countryList,
];
- }, [countries]);
+ }, [countries, t]);
const onCountryChange = (country: string | null) => {
if (readonly) {
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyFieldInput.tsx
index b98c75119fc..7198c0915f0 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyFieldInput.tsx
@@ -8,10 +8,10 @@ import { type VariablePickerComponent } from '@/ui/input/types/VariablePickerCom
import { type FormFieldCurrencyValue } from '@/object-record/record-field/ui/types/FieldMetadata';
import { useCurrencies } from '@/ui/input/components/internal/hooks/useCurrencies';
import { Field } from 'twenty-ui/primitives/input';
-import { t } from '@lingui/core/macro';
import { useMemo } from 'react';
import { type CurrencyCode } from 'twenty-shared/constants';
import { IconCircleOff } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type FormCurrencyFieldInputProps = {
label?: string;
@@ -32,6 +32,7 @@ export const FormCurrencyFieldInput = ({
amountUnit = 'micros',
subFieldPlaceholders,
}: FormCurrencyFieldInputProps) => {
+ const { t } = useLingui();
const localizedCurrencies = useCurrencies();
const currencies = useMemo(() => {
@@ -43,7 +44,7 @@ export const FormCurrencyFieldInput = ({
},
...localizedCurrencies,
];
- }, [localizedCurrencies]);
+ }, [localizedCurrencies, t]);
const handleAmountMicrosChange = (
newAmountMicros: string | number | null,
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFilesFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFilesFieldInput.tsx
index 1221288c0c9..437d3b42a5a 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFilesFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFilesFieldInput.tsx
@@ -5,11 +5,11 @@ import { TextVariableEditor } from '@/object-record/record-field/ui/form-types/c
import { useTextVariableEditor } from '@/object-record/record-field/ui/form-types/hooks/useTextVariableEditor';
import { type VariablePickerComponent } from '@/ui/input/types/VariablePickerComponent';
import { Field } from 'twenty-ui/primitives/input';
-import { t } from '@lingui/core/macro';
import { useId } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
import { turnIntoEmptyStringIfWhitespacesOnly } from '~/utils/string/turnIntoEmptyStringIfWhitespacesOnly';
+import { useLingui } from '@lingui/react/macro';
type FormFilesFieldInputProps = {
label?: string;
@@ -32,6 +32,7 @@ export const FormFilesFieldInput = ({
readonly,
VariablePicker,
}: FormFilesFieldInputProps) => {
+ const { t } = useLingui();
const instanceId = useId();
const stringDefaultValue =
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFullNameFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFullNameFieldInput.tsx
index 4c454bf8f09..4be34688a28 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFullNameFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFullNameFieldInput.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { FormFieldInputContainer } from '@/ui/input/components/FormFieldInputContainer';
import { FormNestedFieldInputContainer } from '@/object-record/record-field/ui/form-types/components/FormNestedFieldInputContainer';
import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/components/FormTextFieldInput';
@@ -6,6 +5,7 @@ import { type VariablePickerComponent } from '@/ui/input/types/VariablePickerCom
import { addCharactersToAvoidPasswordManagers } from '@/object-record/record-field/ui/meta-types/input/utils/addCharactersToAvoidPasswordManagers';
import { type FieldFullNameValue } from '@/object-record/record-field/ui/types/FieldMetadata';
import { Field } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
type FormFullNameFieldInputProps = {
label?: string;
@@ -24,6 +24,7 @@ export const FormFullNameFieldInput = ({
VariablePicker,
subFieldPlaceholders,
}: FormFullNameFieldInputProps) => {
+ const { t } = useLingui();
const handleFirstNameChange = (newText: string) => {
onChange({
lastName: defaultValue?.lastName ?? '',
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormLinksFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormLinksFieldInput.tsx
index f4899f2297f..404070dcef8 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormLinksFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormLinksFieldInput.tsx
@@ -8,10 +8,10 @@ import {
type FormFieldLinksValue,
} from '@/object-record/record-field/ui/types/FieldMetadata';
import { FormFieldInputContainer } from '@/ui/input/components/FormFieldInputContainer';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { isStandaloneVariableString } from 'twenty-shared/workflow';
import { Field } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
type FormLinksFieldInputProps = {
label?: string;
@@ -34,6 +34,7 @@ export const FormLinksFieldInput = ({
maxNumberOfValues,
isPrimaryLinkUrlOnly = false,
}: FormLinksFieldInputProps) => {
+ const { t } = useLingui();
const allowsSecondaryLinks = maxNumberOfValues !== 1;
const secondaryLinks = defaultValue?.secondaryLinks;
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMorphRelationToOneFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMorphRelationToOneFieldInput.tsx
index de5c32ab877..b29ef0b1738 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMorphRelationToOneFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMorphRelationToOneFieldInput.tsx
@@ -14,12 +14,12 @@ import { type VariablePickerComponent } from '@/ui/input/types/VariablePickerCom
import { ForbiddenFieldDisplay } from '@/object-record/record-field/ui/meta-types/display/components/ForbiddenFieldDisplay';
import { Field } from 'twenty-ui/primitives/input';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isString } from '@sniptt/guards';
import { useId } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
import { type JsonValue } from 'type-fest';
+import { useLingui } from '@lingui/react/macro';
const StyledReadonlyContainer = styled.div`
cursor: default;
@@ -62,6 +62,7 @@ export const FormMorphRelationToOneFieldInput = ({
testId,
VariablePicker,
}: FormMorphRelationToOneFieldInputProps) => {
+ const { t } = useLingui();
const { objectMetadataItems } = useObjectMetadataItems();
const { objectPermissionsByObjectMetadataId } = useObjectPermissions();
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordFieldChips.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordFieldChips.tsx
index 604d009960d..a6697585843 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordFieldChips.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordFieldChips.tsx
@@ -6,9 +6,9 @@ import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
import { OverflowingList } from 'twenty-ui/components/layout';
import { isStandaloneVariableString } from 'twenty-shared/workflow';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyArray } from '@sniptt/guards';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledChipsContainer = styled.div`
align-items: center;
@@ -37,6 +37,7 @@ export const FormMultiRecordFieldChips = ({
onUnlinkVariable,
onRemoveStaticVariable,
}: FormMultiRecordFieldChipsProps) => {
+ const { t } = useLingui();
if (draftValue.type === 'variable') {
return (
<StyledChipsContainer>
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordPicker.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordPicker.tsx
index f21fb631324..21a444c87c8 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordPicker.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordPicker.tsx
@@ -19,7 +19,6 @@ import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyArray } from '@sniptt/guards';
import { useId, useState } from 'react';
import { QUERY_MAX_RECORDS } from 'twenty-shared/constants';
@@ -30,6 +29,7 @@ import { IconChevronDown } from 'twenty-ui/icon';
import { Field } from 'twenty-ui/primitives/input';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { mapArrayToObject } from '~/utils/array/mapArrayToObject';
+import { useLingui } from '@lingui/react/macro';
const StyledFormSelectContainerWrapper = styled.div<{ readonly?: boolean }>`
cursor: ${({ readonly }) => (readonly ? 'default' : 'pointer')};
@@ -74,6 +74,7 @@ export const FormMultiRecordPicker = ({
testId,
VariablePicker,
}: FormMultiRecordPickerProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const [draftValue, setDraftValue] = useState<FormMultiRecordPickerDraftValue>(
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiSelectFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiSelectFieldInput.tsx
index 18c1a7aa2d7..3fe0cc8b5dd 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiSelectFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiSelectFieldInput.tsx
@@ -1,7 +1,5 @@
import { hasFullFormFieldBorder } from '@/ui/input/utils/hasFullFormFieldBorder';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
import { FormFieldInputContainer } from '@/ui/input/components/FormFieldInputContainer';
import { FormFieldInputInnerContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputInnerContainer';
import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputRowContainer';
@@ -25,6 +23,7 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { preventDropdownDismissOnInputElement } from '@/ui/layout/dropdown/utils/preventDropdownDismissOnInputElement';
import { IconChevronDown } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type FormMultiSelectFieldInputProps = {
label?: string;
@@ -91,6 +90,7 @@ export const FormMultiSelectFieldInput = ({
hint,
dropdownWidth,
}: FormMultiSelectFieldInputProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const instanceId = useId();
const { closeDropdown } = useCloseDropdown();
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiTextFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiTextFieldInput.tsx
index 9c54756e9ed..9202bf3af43 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiTextFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiTextFieldInput.tsx
@@ -6,10 +6,10 @@ import { useMultiItemFieldEditor } from '@/object-record/record-field/ui/form-ty
import { type VariablePickerComponent } from '@/ui/input/types/VariablePickerComponent';
import { Field } from 'twenty-ui/primitives/input';
import { parseMultiItemEditorContent } from '@/workflow/workflow-variables/utils/parseMultiItemEditorContent';
-import { t } from '@lingui/core/macro';
import { useId } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
type FormMultiTextFieldInputProps = {
label?: string;
@@ -28,6 +28,7 @@ export const FormMultiTextFieldInput = ({
readonly,
VariablePicker,
}: FormMultiTextFieldInputProps) => {
+ const { t } = useLingui();
const instanceId = useId();
const editor = useMultiItemFieldEditor({
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormNumberFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormNumberFieldInput.tsx
index 243c5ab0050..960b48704ca 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormNumberFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormNumberFieldInput.tsx
@@ -6,7 +6,6 @@ import { type VariablePickerComponent } from '@/ui/input/types/VariablePickerCom
import { StyledTextInput } from '@/ui/field/input/components/TextInput';
import { Field } from 'twenty-ui/primitives/input';
import { isStandaloneVariableString } from 'twenty-shared/workflow';
-import { t } from '@lingui/core/macro';
import isEmpty from 'lodash.isempty';
import { useId, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -14,6 +13,7 @@ import {
canBeCastAsNumberOrNull,
castAsNumberOrNull,
} from '~/utils/cast-as-number-or-null';
+import { useLingui } from '@lingui/react/macro';
type FormNumberFieldInputProps = {
label?: string;
@@ -50,6 +50,7 @@ export const FormNumberFieldInput = ({
readonly,
error: errorFromProps,
}: FormNumberFieldInputProps) => {
+ const { t } = useLingui();
const instanceId = useId();
const [errorMessage, setErrorMessage] = useState<string | undefined>(
undefined,
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormPhoneFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormPhoneFieldInput.tsx
index 0129279a938..a00e2d4587c 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormPhoneFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormPhoneFieldInput.tsx
@@ -8,7 +8,7 @@ import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/c
import { type VariablePickerComponent } from '@/ui/input/types/VariablePickerComponent';
import { type FieldPhonesValue } from '@/object-record/record-field/ui/types/FieldMetadata';
import { Field } from 'twenty-ui/primitives/input';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type FormPhoneFieldInputProps = {
label?: string;
@@ -27,6 +27,7 @@ export const FormPhoneFieldInput = ({
VariablePicker,
subFieldPlaceholders,
}: FormPhoneFieldInputProps) => {
+ const { t } = useLingui();
const handleCallingCodeChange = (
newValue: FormCallingCodeSelectInputUpdatedValue,
) => {
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormRawJsonFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormRawJsonFieldInput.tsx
index 5c2260ea1c1..6f993a0e63c 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormRawJsonFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormRawJsonFieldInput.tsx
@@ -1,5 +1,4 @@
import { css, cx } from '@linaria/core';
-import { t } from '@lingui/core/macro';
import { FormFieldInputContainer } from '@/ui/input/components/FormFieldInputContainer';
import { FormFieldInputInnerContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputInnerContainer';
import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputRowContainer';
@@ -11,6 +10,7 @@ import { useId } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
import { turnIntoEmptyStringIfWhitespacesOnly } from '~/utils/string/turnIntoEmptyStringIfWhitespacesOnly';
+import { useLingui } from '@lingui/react/macro';
type FormRawJsonFieldInputProps = {
label?: string;
@@ -41,6 +41,7 @@ export const FormRawJsonFieldInput = ({
className,
fullHeight = false,
}: FormRawJsonFieldInputProps) => {
+ const { t } = useLingui();
const instanceId = useId();
const editor = useTextVariableEditor({
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSelectFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSelectFieldInput.tsx
index a20b8890c2e..ed479f6885c 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSelectFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSelectFieldInput.tsx
@@ -8,7 +8,6 @@ import { type SelectCallToActionButton } from '@/ui/input/types/SelectCallToActi
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { useRemoveFocusItemFromFocusStackById } from '@/ui/utilities/focus/hooks/useRemoveFocusItemFromFocusStackById';
import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useId, useState } from 'react';
import { Key } from 'ts-key-enum';
@@ -18,6 +17,7 @@ import { isStandaloneVariableString } from 'twenty-shared/workflow';
import { IconCircleOff } from 'twenty-ui/icon';
import { Field, type SelectOption } from 'twenty-ui/primitives/input';
import { useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type FormSelectFieldInputProps = {
label?: string;
@@ -44,6 +44,7 @@ export const FormSelectFieldInput = ({
callToActionButton,
placeholder,
}: FormSelectFieldInputProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const instanceId = useId();
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordFieldChip.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordFieldChip.tsx
index ebeb8c4c065..4e9a841ab1b 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordFieldChip.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordFieldChip.tsx
@@ -9,10 +9,10 @@ import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
import { type FormFieldInputVariant } from '@/ui/input/types/FormFieldInputVariant';
import { isStandaloneVariableString } from 'twenty-shared/workflow';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconForbid } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const getInset = ({ $variant }: { $variant?: FormFieldInputVariant }) =>
$variant === 'transparent' ? '0' : themeCssVariables.spacing[2];
@@ -68,6 +68,7 @@ export const FormSingleRecordFieldChip = ({
disabled,
variant,
}: FormSingleRecordFieldChipProps) => {
+ const { t } = useLingui();
if (
draftValue.type === 'variable' &&
isStandaloneVariableString(draftValue.value)
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx
index bf92e194ff4..301924fd3fc 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx
@@ -22,13 +22,13 @@ import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSe
import { isStandaloneVariableString } from 'twenty-shared/workflow';
import { hasFullFormFieldBorder } from '@/ui/input/utils/hasFullFormFieldBorder';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type KeyboardEvent, useCallback, useId, useState } from 'react';
import { CustomError, isDefined, isValidUuid } from 'twenty-shared/utils';
import { Key } from 'ts-key-enum';
import { doNotTranslate } from 'twenty-shared/i18n';
import { IconChevronDown, IconForbid } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledFormSelectContainerWrapper = styled.div<{
readonly?: boolean;
@@ -114,6 +114,7 @@ export const FormSingleRecordPicker = ({
dropdownId: dropdownIdFromProps,
variant,
}: FormSingleRecordPickerProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const resolvedObjectNameSingular =
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormTextFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormTextFieldInput.tsx
index 42c7ea8fc1e..1720910103f 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormTextFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormTextFieldInput.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { FormFieldInputContainer } from '@/ui/input/components/FormFieldInputContainer';
import { FormFieldInputInnerContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputInnerContainer';
import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputRowContainer';
@@ -10,6 +9,7 @@ import { parseEditorContent } from '@/workflow/workflow-variables/utils/parseEdi
import { useId } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
type FormTextFieldInputProps = {
label?: string;
@@ -40,6 +40,7 @@ export const FormTextFieldInput = ({
ariaLabel,
enableTemplateVariableFallback,
}: FormTextFieldInputProps) => {
+ const { t } = useLingui();
const instanceId = useId();
const labelId = `${instanceId}-label`;
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormUuidFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormUuidFieldInput.tsx
index 8a6ae4e138b..b0df042b190 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormUuidFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormUuidFieldInput.tsx
@@ -6,9 +6,9 @@ import { type VariablePickerComponent } from '@/ui/input/types/VariablePickerCom
import { StyledTextInput } from '@/ui/field/input/components/TextInput';
import { Field } from 'twenty-ui/primitives/input';
import { isStandaloneVariableString } from 'twenty-shared/workflow';
-import { t } from '@lingui/core/macro';
import { useId, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
type FormUuidFieldInputProps = {
label?: string;
@@ -27,6 +27,7 @@ export const FormUuidFieldInput = ({
readonly,
VariablePicker,
}: FormUuidFieldInputProps) => {
+ const { t } = useLingui();
const instanceId = useId();
const [draftValue, setDraftValue] = useState<
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInput.tsx
index 3a070f93dff..55550b92649 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInput.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useCallback, useId, useMemo, useState } from 'react';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -28,6 +27,7 @@ import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { isStandaloneVariableString } from 'twenty-shared/workflow';
+import { useLingui } from '@lingui/react/macro';
const StyledFormSelectContainerWrapper = styled.div<{ readonly?: boolean }>`
cursor: ${({ readonly }) => (readonly ? 'default' : 'pointer')};
@@ -58,6 +58,7 @@ export const FormWorkspaceMemberFilterValueInput = ({
readonly,
VariablePicker,
}: FormWorkspaceMemberFilterValueInputProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const componentId = useId();
@@ -190,6 +191,7 @@ export const FormWorkspaceMemberFilterValueInput = ({
recordsToSelect,
selectedRecordIds,
selectedRecords,
+ t,
]);
const triggerContent = (
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInputDropdownContent.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInputDropdownContent.tsx
index e5a7849960f..e135aa44737 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInputDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInputDropdownContent.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { isNonEmptyArray } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
import { IconUserCircle } from 'twenty-ui/icon';
@@ -10,6 +9,7 @@ import { type SelectableItem } from '@/object-record/select/types/SelectableItem
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
import { normalizeSearchText } from 'twenty-ui/utilities';
+import { useLingui } from '@lingui/react/macro';
type FormWorkspaceMemberFilterValueInputDropdownContentProps = {
searchFilter: string;
@@ -33,6 +33,7 @@ export const FormWorkspaceMemberFilterValueInputDropdownContent = ({
loading,
onSelectChange,
}: FormWorkspaceMemberFilterValueInputDropdownContentProps) => {
+ const { t } = useLingui();
const isMeVisible = normalizeSearchText(t`Me`).includes(
normalizeSearchText(searchFilter),
);
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInputTrigger.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInputTrigger.tsx
index de20d8d3d03..becce482ca6 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInputTrigger.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInputTrigger.tsx
@@ -1,11 +1,11 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconUserCircle } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
import { FormFieldPlaceholder } from '@/object-record/record-field/ui/form-types/components/FormFieldPlaceholder';
import { VariableChipStandalone } from '@/object-record/record-field/ui/form-types/components/VariableChipStandalone';
+import { useLingui } from '@lingui/react/macro';
const StyledTriggerLabel = styled.div`
align-items: center;
@@ -40,6 +40,7 @@ export const FormWorkspaceMemberFilterValueInputTrigger = ({
readonly,
onUnlinkVariable,
}: FormWorkspaceMemberFilterValueInputTriggerProps) => {
+ const { t } = useLingui();
if (isVariableValue) {
return (
<VariableChipStandalone
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useGetSecondaryFieldButton.ts b/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useGetSecondaryFieldButton.ts
index 0bb7702cf85..d3a618920b4 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useGetSecondaryFieldButton.ts
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useGetSecondaryFieldButton.ts
@@ -9,15 +9,16 @@ import { isFieldEmails } from '@/object-record/record-field/ui/types/guards/isFi
import { isFieldLinks } from '@/object-record/record-field/ui/types/guards/isFieldLinks';
import { isFieldPhones } from '@/object-record/record-field/ui/types/guards/isFieldPhones';
import { useRecordFieldValue } from '@/object-record/record-store/hooks/useRecordFieldValue';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { FieldMetadataSettingsOnClickAction } from 'twenty-shared/types';
import { ensureAbsoluteUrl, isDefined } from 'twenty-shared/utils';
import { IconArrowUpRight, IconCopy, IconMail } from 'twenty-ui/icon';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
import { openUrlInNewTab } from '~/utils/openUrlInNewTab';
+import { useLingui } from '@lingui/react/macro';
export const useGetSecondaryFieldButton = () => {
+ const { t } = useLingui();
const { fieldDefinition, recordId } = useContext(FieldContext);
const { copyToClipboard } = useCopyToClipboard();
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/display/components/JsonFieldDisplay.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/display/components/JsonFieldDisplay.tsx
index 6e050d45d57..3d4722c3868 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/display/components/JsonFieldDisplay.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/display/components/JsonFieldDisplay.tsx
@@ -1,13 +1,14 @@
import { useJsonFieldDisplay } from '@/object-record/record-field/ui/meta-types/hooks/useJsonFieldDisplay';
import { JsonDisplay } from '@/ui/field/display/components/JsonDisplay/JsonDisplay';
import { ExpandedFieldDisplay } from '@/ui/layout/expandable-list/components/ExpandedFieldDisplay';
-import { t } from '@lingui/core/macro';
import { useRef, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { JsonTree } from 'twenty-ui/components/data-display';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
+import { useLingui } from '@lingui/react/macro';
export const JsonFieldDisplay = () => {
+ const { t } = useLingui();
const { copyToClipboard } = useCopyToClipboard();
const { fieldValue, maxWidth, isRecordFieldReadOnly } = useJsonFieldDisplay();
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/ArrayFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/ArrayFieldInput.tsx
index 1f18369fb73..77096a39c44 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/ArrayFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/ArrayFieldInput.tsx
@@ -14,16 +14,17 @@ import { useMultiItemSearch } from '@/object-record/record-field/ui/meta-types/i
import { computeUpdatedMultiItemFieldItems } from '@/object-record/record-field/ui/meta-types/input/utils/computeUpdatedMultiItemFieldItems';
import { type MultiItemFieldInputSpacing } from '@/object-record/record-field/ui/meta-types/input/types/MultiItemFieldInputSpacing';
import { arrayFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/arrayFieldValueSchema';
-import { t } from '@lingui/core/macro';
import { useContext, useMemo, useRef } from 'react';
import { MULTI_ITEM_FIELD_DEFAULT_MAX_VALUES } from 'twenty-shared/constants';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { toSpliced } from '~/utils/array/toSpliced';
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
+import { useLingui } from '@lingui/react/macro';
const getArrayItemText = (item: string) => item;
export const ArrayFieldInput = () => {
+ const { t } = useLingui();
const { setDraftValue, draftValue, fieldDefinition } = useArrayField();
const { onEscape, onClickOutside, onEnter, onSubmit } = useContext(
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/CurrencyFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/CurrencyFieldInput.tsx
index 1f6c62e006b..8d832f0d6ef 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/CurrencyFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/CurrencyFieldInput.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { type FieldCurrencyValue } from '@/object-record/record-field/ui/types/FieldMetadata';
@@ -17,8 +16,10 @@ import {
convertCurrencyAmountToCurrencyMicros,
isDefined,
} from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
export const CurrencyFieldInput = () => {
+ const { t } = useLingui();
const { fieldValue, draftValue, setDraftValue, defaultValue } =
useCurrencyField();
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/LinksFieldEditInputs.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/LinksFieldEditInputs.tsx
index 1fc462d225f..73b3165d9ce 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/LinksFieldEditInputs.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/LinksFieldEditInputs.tsx
@@ -1,9 +1,9 @@
import { getMultiItemInputKeyDownHandler } from '@/object-record/record-field/ui/meta-types/input/utils/getMultiItemInputKeyDownHandler';
import { TextInput } from '@/ui/input/components/TextInput';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useCallback } from 'react';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledLinksFieldEditInputsContainer = styled.div`
display: flex;
@@ -33,6 +33,7 @@ export const LinksFieldEditInputs = ({
onEscape,
onUrlBlur,
}: LinksFieldEditInputsProps) => {
+ const { t } = useLingui();
const scrollIntoViewOnMount = useCallback((node: HTMLDivElement | null) => {
node?.scrollIntoView({ block: 'nearest' });
}, []);
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MorphRelationManyToOneFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MorphRelationManyToOneFieldInput.tsx
index 9f3c5a7c721..c29ea54f6d9 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MorphRelationManyToOneFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MorphRelationManyToOneFieldInput.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { FieldInputEventContext } from '@/object-record/record-field/ui/contexts/FieldInputEventContext';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
@@ -17,8 +16,10 @@ import { useContext } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
import { IconForbid } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const MorphRelationManyToOneFieldInput = () => {
+ const { t } = useLingui();
const { fieldDefinition, recordId } = useContext(FieldContext);
const { onCancel } = useContext(FieldInputEventContext);
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldMenuItem.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldMenuItem.tsx
index b0d56323242..11c7dbc541d 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldMenuItem.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldMenuItem.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { MenuItemWithOptionDropdown } from '@/ui/navigation/menu-item/components/MenuItemWithOptionDropdown';
import React, { useState } from 'react';
import { Dropdown } from 'twenty-ui/components/navigation';
@@ -9,6 +8,7 @@ import {
IconPencil,
IconTrash,
} from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type MultiItemFieldMenuItemProps<TValue> = {
dropdownId: string;
@@ -37,6 +37,7 @@ export const MultiItemFieldMenuItem = <TValue,>({
showCopyButton,
onCopy,
}: MultiItemFieldMenuItemProps<TValue>) => {
+ const { t } = useLingui();
const [isHovered, setIsHovered] = useState(false);
const handleMouseEnter = () => setIsHovered(true);
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldSaveButton.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldSaveButton.tsx
index 004029bd92c..56f029811ab 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldSaveButton.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldSaveButton.tsx
@@ -1,6 +1,6 @@
-import { t } from '@lingui/core/macro';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconCheck, IconPlus } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type MultiItemFieldSaveButtonProps = {
isAddingNewItem: boolean;
@@ -10,11 +10,14 @@ type MultiItemFieldSaveButtonProps = {
export const MultiItemFieldSaveButton = ({
isAddingNewItem,
onClick,
-}: MultiItemFieldSaveButtonProps) => (
- <LightIconButton
- onClick={onClick}
- aria-label={isAddingNewItem ? t`Add item` : t`Save item`}
- >
- {isAddingNewItem ? <IconPlus /> : <IconCheck />}
- </LightIconButton>
-);
+}: MultiItemFieldSaveButtonProps) => {
+ const { t } = useLingui();
+ return (
+ <LightIconButton
+ onClick={onClick}
+ aria-label={isAddingNewItem ? t`Add item` : t`Save item`}
+ >
+ {isAddingNewItem ? <IconPlus /> : <IconCheck />}
+ </LightIconButton>
+ );
+};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/PhonesFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/PhonesFieldInput.tsx
index aad70689089..b7c43daee9a 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/PhonesFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/PhonesFieldInput.tsx
@@ -24,7 +24,6 @@ import {
} from '@/object-record/record-field/ui/types/FieldMetadata';
import { phonesFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/phonesFieldValueSchema';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
-import { t } from '@lingui/core/macro';
import { useContext, useRef } from 'react';
import { MULTI_ITEM_FIELD_DEFAULT_MAX_VALUES } from 'twenty-shared/constants';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
@@ -32,8 +31,10 @@ import { moveArrayItem } from '~/utils/array/moveArrayItem';
import { toSpliced } from '~/utils/array/toSpliced';
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
import { stripSimpleQuotesFromString } from '~/utils/string/stripSimpleQuotesFromString';
+import { useLingui } from '@lingui/react/macro';
export const PhonesFieldInput = () => {
+ const { t } = useLingui();
const { fieldDefinition, setDraftValue, draftValue } = usePhonesField();
const { onEscape, onClickOutside, onEnter, onSubmit } = useContext(
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/RichTextFieldEditor.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/RichTextFieldEditor.tsx
index 447c735a9d6..29280ddc54b 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/RichTextFieldEditor.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/RichTextFieldEditor.tsx
@@ -31,12 +31,12 @@ import { useRemoveFocusItemFromFocusStackById } from '@/ui/utilities/focus/hooks
import { FocusComponentType } from '@/ui/utilities/focus/types/FocusComponentType';
import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type Editor } from '@tiptap/core';
import { Key } from 'ts-key-enum';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
import { useDebouncedCallback } from 'use-debounce';
+import { useLingui } from '@lingui/react/macro';
const StyledEditorContainer = styled.div`
box-sizing: border-box;
@@ -65,6 +65,7 @@ export const RichTextFieldEditor = ({
onBlur: onBlurOverride,
editorRef,
}: RichTextFieldEditorProps) => {
+ const { t } = useLingui();
const store = useStore();
const [recordInStore] = useAtom(recordStoreFamilyState.atomFamily(recordId));
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/RichTextFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/RichTextFieldInput.tsx
index adf1e5c7575..2367c64326f 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/RichTextFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/RichTextFieldInput.tsx
@@ -7,13 +7,13 @@ import { type FieldRichTextMetadata } from '@/object-record/record-field/ui/type
import { useOpenRichTextInSidePanel } from '@/side-panel/hooks/useOpenRichTextInSidePanel';
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Suspense, lazy, useContext, useRef } from 'react';
import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { IconButton } from 'twenty-ui/components/input';
import { IconLayoutSidebarLeftCollapse } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const ActivityRichTextEditor = lazy(() =>
import('@/activities/components/ActivityRichTextEditor').then((module) => ({
@@ -75,6 +75,7 @@ const isActivityObject = (
objectNameSingular === CoreObjectNameSingular.Task;
export const RichTextFieldInput = () => {
+ const { t } = useLingui();
const { fieldDefinition, recordId } = useContext(FieldContext);
const metadata = (fieldDefinition as { metadata: FieldRichTextMetadata })
diff --git a/packages/twenty-front/src/modules/object-record/record-form/components/RecordFormCurrencyFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-form/components/RecordFormCurrencyFieldInput.tsx
index 2d8cf908466..a3b1572f1f5 100644
--- a/packages/twenty-front/src/modules/object-record/record-form/components/RecordFormCurrencyFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-form/components/RecordFormCurrencyFieldInput.tsx
@@ -6,7 +6,6 @@ import { recordFieldInputIsFieldInErrorComponentState } from '@/object-record/re
import { RecordFormTextInput } from '@/object-record/record-form/components/RecordFormTextInput';
import { CurrencyPickerDropdownButton } from '@/ui/input/components/internal/currency/components/CurrencyPickerDropdownButton';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useState } from 'react';
import { CurrencyCode } from 'twenty-shared/constants';
@@ -19,6 +18,7 @@ import {
canBeCastAsNumberOrNull,
castAsNumberOrNull,
} from '~/utils/cast-as-number-or-null';
+import { useLingui } from '@lingui/react/macro';
type RecordFormCurrencyFieldInputProps = {
label?: string;
@@ -37,6 +37,7 @@ export const RecordFormCurrencyFieldInput = ({
readonly,
placeholder,
}: RecordFormCurrencyFieldInputProps) => {
+ const { t } = useLingui();
const setRecordFieldInputIsFieldInError = useSetAtomComponentState(
recordFieldInputIsFieldInErrorComponentState,
);
diff --git a/packages/twenty-front/src/modules/object-record/record-form/components/RecordFormPercentageFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-form/components/RecordFormPercentageFieldInput.tsx
index 1d9b8f6e8e7..00b6c593f50 100644
--- a/packages/twenty-front/src/modules/object-record/record-form/components/RecordFormPercentageFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-form/components/RecordFormPercentageFieldInput.tsx
@@ -5,9 +5,9 @@ import { type FieldNumberMetadata } from '@/object-record/record-field/ui/types/
import { computeDraftValueFromFieldValue } from '@/object-record/record-field/ui/utils/computeDraftValueFromFieldValue';
import { RecordFormTextInput } from '@/object-record/record-form/components/RecordFormTextInput';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
type RecordFormPercentageFieldInputProps = {
field: Pick<
@@ -25,6 +25,7 @@ export const RecordFormPercentageFieldInput = ({
onChange,
readonly,
}: RecordFormPercentageFieldInputProps) => {
+ const { t } = useLingui();
const setRecordFieldInputIsFieldInError = useSetAtomComponentState(
recordFieldInputIsFieldInErrorComponentState,
);
diff --git a/packages/twenty-front/src/modules/object-record/record-group/components/AddRecordGroupButton.tsx b/packages/twenty-front/src/modules/object-record/record-group/components/AddRecordGroupButton.tsx
index 67dca691246..2c1f7144b1b 100644
--- a/packages/twenty-front/src/modules/object-record/record-group/components/AddRecordGroupButton.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-group/components/AddRecordGroupButton.tsx
@@ -7,11 +7,11 @@ import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { type DropdownOffset } from '@/ui/layout/dropdown/types/DropdownOffset';
import { useGetCurrentViewOnly } from '@/views/hooks/useGetCurrentViewOnly';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { LightButton } from 'twenty-ui/components/input';
import { IconPlus } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type AddRecordGroupButtonProps = {
fieldMetadataItem: FieldMetadataItem;
@@ -24,6 +24,7 @@ export const AddRecordGroupButton = ({
dropdownId,
dropdownOffset,
}: AddRecordGroupButtonProps) => {
+ const { t } = useLingui();
const { currentView } = useGetCurrentViewOnly();
const { addRecordGroup } = useAddRecordGroup();
const { closeDropdown } = useCloseDropdown();
diff --git a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdown.tsx b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdown.tsx
index a0275a38423..280b37f0989 100644
--- a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdown.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdown.tsx
@@ -6,8 +6,8 @@ import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DROPDOWN_OFFSET_Y } from '@/ui/layout/dropdown/constants/DropdownOffsetY';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type Nullable } from 'twenty-shared/types';
+import { useLingui } from '@lingui/react/macro';
type RecordGroupAggregateDropdownProps = {
aggregateValue?: Nullable<string | number>;
@@ -26,6 +26,7 @@ export const RecordGroupAggregateDropdown = ({
aggregateLabel,
dropdownId,
}: RecordGroupAggregateDropdownProps) => {
+ const { t } = useLingui();
return (
<RecordGroupAggregateDropdownComponentInstanceContext.Provider
value={{ instanceId: dropdownId }}
diff --git a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownContent.tsx b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownContent.tsx
index bd9c11a7234..97c8235af83 100644
--- a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownContent.tsx
@@ -7,8 +7,8 @@ import { DATE_AGGREGATE_OPERATION_OPTIONS } from '@/object-record/record-table/r
import { NON_STANDARD_AGGREGATE_OPERATION_OPTIONS } from '@/object-record/record-table/record-table-footer/constants/NonStandardAggregateOperationsOptions';
import { PERCENT_AGGREGATE_OPERATION_OPTIONS } from '@/object-record/record-table/record-table-footer/constants/PercentAggregateOperationOptions';
import { getAvailableFieldsIdsForAggregationFromObjectFields } from '@/object-record/utils/getAvailableFieldsIdsForAggregationFromObjectFields';
-import { t } from '@lingui/core/macro';
import { Dropdown } from 'twenty-ui/components/navigation';
+import { useLingui } from '@lingui/react/macro';
type RecordGroupAggregateDropdownContentProps = {
objectMetadataItem: EnrichedObjectMetadataItem;
@@ -17,6 +17,7 @@ type RecordGroupAggregateDropdownContentProps = {
export const RecordGroupAggregateDropdownContent = ({
objectMetadataItem,
}: RecordGroupAggregateDropdownContentProps) => {
+ const { t } = useLingui();
const { readableFields } = objectMetadataItem;
const pages = [
diff --git a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupRelationChip.tsx b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupRelationChip.tsx
index e445458f4c8..b448a681a2a 100644
--- a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupRelationChip.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupRelationChip.tsx
@@ -2,9 +2,9 @@ import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataIte
import { RecordChip } from '@/object-record/components/RecordChip';
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { Tag } from 'twenty-ui/primitives/data-display';
+import { useLingui } from '@lingui/react/macro';
type RecordGroupRelationChipProps = {
fieldMetadataItem: FieldMetadataItem;
@@ -15,6 +15,7 @@ export const RecordGroupRelationChip = ({
fieldMetadataItem,
recordId,
}: RecordGroupRelationChipProps) => {
+ const { t } = useLingui();
const targetObjectNameSingular =
fieldMetadataItem.relation?.targetObjectMetadata.nameSingular;
diff --git a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupReorderConfirmationModal.tsx b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupReorderConfirmationModal.tsx
index 0cb3fe62200..5991f8e0057 100644
--- a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupReorderConfirmationModal.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupReorderConfirmationModal.tsx
@@ -4,9 +4,9 @@ import { useRecordIndexContextOrThrow } from '@/object-record/record-index/conte
import { recordIndexRecordGroupSortComponentState } from '@/object-record/record-index/states/recordIndexRecordGroupSortComponentState';
import { ConfirmationDialog } from '@/ui/layout/dialog/components/ConfirmationDialog';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { createPortal } from 'react-dom';
+import { useLingui } from '@lingui/react/macro';
type RecordGroupReorderConfirmationModalProps = {
onConfirmClick: () => void;
@@ -15,6 +15,7 @@ type RecordGroupReorderConfirmationModalProps = {
export const RecordGroupReorderConfirmationModal = ({
onConfirmClick,
}: RecordGroupReorderConfirmationModalProps): ReactNode => {
+ const { t } = useLingui();
const { recordIndexId } = useRecordIndexContextOrThrow();
const recordIndexRecordGroupSort = useAtomComponentStateValue(
recordIndexRecordGroupSortComponentState,
diff --git a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupSectionHeader.tsx b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupSectionHeader.tsx
index f2830100ff9..21e6a5e0eb6 100644
--- a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupSectionHeader.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupSectionHeader.tsx
@@ -2,9 +2,9 @@ import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataIte
import { RecordGroupChip } from '@/object-record/record-group/components/RecordGroupChip';
import { type RecordGroupDefinition } from '@/object-record/record-group/types/RecordGroupDefinition';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { IconChevronDown } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledSectionToggle = styled.button`
align-items: center;
@@ -47,6 +47,7 @@ export const RecordGroupSectionHeader = ({
onToggle,
chevronWidth,
}: RecordGroupSectionHeaderProps) => {
+ const { t } = useLingui();
const theme = useTheme();
return (
diff --git a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupVisibilityRow.tsx b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupVisibilityRow.tsx
index a7fa97cde4d..fb1abfa3873 100644
--- a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupVisibilityRow.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupVisibilityRow.tsx
@@ -8,10 +8,10 @@ import {
import { recordIndexGroupFieldMetadataItemComponentState } from '@/object-record/record-index/states/recordIndexGroupFieldMetadataComponentState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconEye, IconEyeOff } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type RecordGroupVisibilityRowProps = {
recordGroupId: string;
@@ -28,6 +28,7 @@ export const RecordGroupVisibilityRow = ({
onVisibilityChange,
isVisibleLimitReached = false,
}: RecordGroupVisibilityRowProps) => {
+ const { t } = useLingui();
const recordGroupDefinition = useAtomFamilyStateValue(
recordGroupDefinitionFamilyState,
recordGroupId,
diff --git a/packages/twenty-front/src/modules/object-record/record-group/hooks/useRecordGroupActions.ts b/packages/twenty-front/src/modules/object-record/record-group/hooks/useRecordGroupActions.ts
index 5f21dc8f870..40ce9ca8686 100644
--- a/packages/twenty-front/src/modules/object-record/record-group/hooks/useRecordGroupActions.ts
+++ b/packages/twenty-front/src/modules/object-record/record-group/hooks/useRecordGroupActions.ts
@@ -13,7 +13,6 @@ import { useAtomComponentFamilySelectorValue } from '@/ui/utilities/state/jotai/
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { type ViewType } from '@/views/types/ViewType';
-import { t } from '@lingui/core/macro';
import { isUndefined } from '@sniptt/guards';
import { useCallback, useContext } from 'react';
import { useLocation } from 'react-router-dom';
@@ -28,6 +27,7 @@ import {
} from 'twenty-ui/icon';
import { PermissionFlagType } from '~/generated-metadata/graphql';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+import { useLingui } from '@lingui/react/macro';
type UseRecordGroupActionsParams = {
viewType: ViewType;
@@ -36,6 +36,7 @@ type UseRecordGroupActionsParams = {
export const useRecordGroupActions = ({
viewType,
}: UseRecordGroupActionsParams) => {
+ const { t } = useLingui();
const { recordIndexId } = useRecordIndexIdFromCurrentContextStore();
const navigate = useNavigateSettings();
const location = useLocation();
diff --git a/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexEmptyStateNotShared.tsx b/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexEmptyStateNotShared.tsx
index 08063d55640..087c79ad0bf 100644
--- a/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexEmptyStateNotShared.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexEmptyStateNotShared.tsx
@@ -3,8 +3,8 @@ import { getNonReadableViewFieldSubTitle } from '@/object-record/record-index/ut
import { AnimatedPlaceholder } from '@/ui/feedback/empty-state/components/AnimatedPlaceholder/AnimatedPlaceholder';
import { EmptyState } from '@/ui/feedback/empty-state/components/EmptyState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
const StyledEmptyPlaceholderOuterContainer = styled.div`
height: 100%;
@@ -18,6 +18,7 @@ type RecordIndexEmptyStateNotSharedProps = {
export const RecordIndexEmptyStateNotShared = ({
nonReadableViewFieldInfo,
}: RecordIndexEmptyStateNotSharedProps) => {
+ const { t } = useLingui();
return (
<StyledEmptyPlaceholderOuterContainer>
<EmptyState.Root>
diff --git a/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexPageHeaderTitle.tsx b/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexPageHeaderTitle.tsx
index bb375b15c62..a2b1dbbc6ba 100644
--- a/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexPageHeaderTitle.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexPageHeaderTitle.tsx
@@ -1,7 +1,7 @@
import { useNumberFormat } from '@/localization/hooks/useNumberFormat';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledTitleWithSelectedRecords = styled.div`
display: flex;
@@ -28,6 +28,7 @@ export const RecordIndexPageHeaderTitle = ({
label,
numberOfSelectedRecords,
}: RecordIndexPageHeaderTitleProps) => {
+ const { t } = useLingui();
const { formatNumber } = useNumberFormat();
if (numberOfSelectedRecords === 0) {
diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellEditButton.tsx b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellEditButton.tsx
index 8e3fd568d72..dd8d18ef203 100644
--- a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellEditButton.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellEditButton.tsx
@@ -1,8 +1,8 @@
import { AnimatedContainer } from '@/ui/layout/animation/components/internal/AnimatedContainer/AnimatedContainer';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { IconButton } from 'twenty-ui/components/input';
import { type IconComponent } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
const StyledInlineCellButtonContainer = styled.div`
align-items: center;
@@ -18,6 +18,7 @@ export const RecordInlineCellButton = ({
onClick?: () => void;
ariaLabel?: string;
}) => {
+ const { t } = useLingui();
return (
<AnimatedContainer>
<StyledInlineCellButtonContainer>
diff --git a/packages/twenty-front/src/modules/object-record/record-list/components/RecordListAddNew.tsx b/packages/twenty-front/src/modules/object-record/record-list/components/RecordListAddNew.tsx
index 425cdd0ce8f..7cfaccb8f8b 100644
--- a/packages/twenty-front/src/modules/object-record/record-list/components/RecordListAddNew.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-list/components/RecordListAddNew.tsx
@@ -8,14 +8,15 @@ import { useCreateNewIndexRecord } from '@/object-record/record-table/hooks/useC
import { canCreateRecordsForObjectMetadataItem } from '@/object-record/utils/canCreateRecordsForObjectMetadataItem';
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
import { LightButton } from 'twenty-ui/components/input';
import { IconPlus } from 'twenty-ui/icon';
import { logError } from '~/utils/logError';
+import { useLingui } from '@lingui/react/macro';
export const RecordListAddNew = () => {
+ const { t } = useLingui();
const { objectMetadataItem } = useRecordIndexContextOrThrow();
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/modules/object-record/record-list/components/RecordListRow.tsx b/packages/twenty-front/src/modules/object-record/record-list/components/RecordListRow.tsx
index e182c67634e..92eb8778695 100644
--- a/packages/twenty-front/src/modules/object-record/record-list/components/RecordListRow.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-list/components/RecordListRow.tsx
@@ -22,12 +22,13 @@ import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { styled } from '@linaria/react';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { type MouseEvent, type Ref, useContext } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { Chip } from 'twenty-ui/primitives/data-display';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledRowContainer = styled.div`
cursor: pointer;
@@ -82,6 +83,7 @@ type RecordListRowProps = {
};
export const RecordListRow = ({ recordId, rowRef }: RecordListRowProps) => {
+ const { t } = useLingui();
const { objectNameSingular } = useRecordIndexContextOrThrow();
const {
labelIdentifierFieldMetadataItem,
diff --git a/packages/twenty-front/src/modules/object-record/record-merge/components/MergePrioritySettings.tsx b/packages/twenty-front/src/modules/object-record/record-merge/components/MergePrioritySettings.tsx
index bf3beae391a..4f18e7e30ef 100644
--- a/packages/twenty-front/src/modules/object-record/record-merge/components/MergePrioritySettings.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-merge/components/MergePrioritySettings.tsx
@@ -1,11 +1,11 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Section } from 'twenty-ui/components/layout';
import { themeCssVariables } from 'twenty-ui/theme';
import { getPositionNumberIcon } from '@/object-record/record-merge/utils/getPositionNumberIcon';
import { getPositionWordLabel } from '@/object-record/record-merge/utils/getPositionWordLabel';
import { Select } from '@/ui/input/components/Select';
+import { useLingui } from '@lingui/react/macro';
const MISSING_PRIORITY_RECORD_INDEX = -1;
@@ -29,6 +29,7 @@ export const MergePrioritySettings = ({
dropdownId,
disabled = false,
}: MergePrioritySettingsProps) => {
+ const { t } = useLingui();
const priorityOptions = Array.from(
{ length: selectedRecordCount },
(_, index) => {
diff --git a/packages/twenty-front/src/modules/object-record/record-merge/components/MergeRecordsContainer.tsx b/packages/twenty-front/src/modules/object-record/record-merge/components/MergeRecordsContainer.tsx
index 9c1dcd5fde7..04cc9dcaa7e 100644
--- a/packages/twenty-front/src/modules/object-record/record-merge/components/MergeRecordsContainer.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-merge/components/MergeRecordsContainer.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { TabListRoot } from '@/ui/layout/tab-list/components/TabListRoot';
import { Tabs } from 'twenty-ui/primitives/navigation';
import { styled } from '@linaria/react';
@@ -21,6 +20,7 @@ import { MergePreviewTab } from './MergePreviewTab';
import { MergeRecordTab } from './MergeRecordTab';
import { MergeRecordsFooter } from './MergeRecordsFooter';
import { MergeSettingsTab } from './MergeSettingsTab';
+import { useLingui } from '@lingui/react/macro';
const StyledShowPageRightContainer = styled.div`
display: flex;
@@ -48,6 +48,7 @@ type MergeRecordsContainerProps = {
export const MergeRecordsContainer = ({
objectNameSingular,
}: MergeRecordsContainerProps) => {
+ const { t } = useLingui();
const { selectedRecords } = useMergeRecordsSelectedRecords();
const { tabs } = useMergeRecordsContainerTabs(selectedRecords);
diff --git a/packages/twenty-front/src/modules/object-record/record-merge/components/MergeRecordsFooter.tsx b/packages/twenty-front/src/modules/object-record/record-merge/components/MergeRecordsFooter.tsx
index 44aba3f8bbf..d774a6fdd14 100644
--- a/packages/twenty-front/src/modules/object-record/record-merge/components/MergeRecordsFooter.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-merge/components/MergeRecordsFooter.tsx
@@ -3,9 +3,9 @@ import { useMergeRecordsActions } from '@/object-record/record-merge/hooks/useMe
import { SidePanelFooter } from '@/ui/layout/side-panel/components/SidePanelFooter';
import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';
import { Key } from 'ts-key-enum';
-import { t } from '@lingui/core/macro';
import { IconArrowMerge } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
type MergeRecordsFooterProps = {
objectNameSingular: string;
@@ -14,6 +14,7 @@ type MergeRecordsFooterProps = {
export const MergeRecordsFooter = ({
objectNameSingular,
}: MergeRecordsFooterProps) => {
+ const { t } = useLingui();
const { handleMergeRecords, isMerging } = useMergeRecordsActions({
objectNameSingular,
});
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPicker.tsx b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPicker.tsx
index 20abeb3c2c5..90fccb87f24 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPicker.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPicker.tsx
@@ -27,9 +27,9 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { type RecordPickerLayoutDirection } from '@/object-record/record-picker/types/RecordPickerLayoutDirection';
import { getMultipleRecordPickerLayoutDirection } from '@/object-record/record-picker/multiple-record-picker/utils/getMultipleRecordPickerLayoutDirection';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
-import { t } from '@lingui/core/macro';
import { IconPlus } from 'twenty-ui/icon';
import { logError } from '~/utils/logError';
+import { useLingui } from '@lingui/react/macro';
type MultipleRecordPickerProps = {
onChange?: (morphItem: RecordPickerPickableMorphItem) => void;
@@ -58,6 +58,7 @@ export const MultipleRecordPicker = ({
componentInstanceId,
isCreatePending = false,
}: MultipleRecordPickerProps) => {
+ const { t } = useLingui();
const { page, isActive, goBack } = useDropdownPage();
const { side, align } = useDropdownPlacementOrThrow();
const resolvedLayoutDirection = getMultipleRecordPickerLayoutDirection({
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerCreateTargetSelect.tsx b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerCreateTargetSelect.tsx
index f9d9492bc34..1daaeb0f2a7 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerCreateTargetSelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerCreateTargetSelect.tsx
@@ -1,9 +1,9 @@
import { ObjectMetadataIcon } from '@/object-metadata/components/ObjectMetadataIcon';
import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
-import { t } from '@lingui/core/macro';
import { Dropdown } from 'twenty-ui/components/navigation';
import { type KeyboardEvent } from 'react';
import { Key } from 'ts-key-enum';
+import { useLingui } from '@lingui/react/macro';
type MultipleRecordPickerCreateTargetSelectProps = {
objectMetadataItems: EnrichedObjectMetadataItem[];
@@ -18,6 +18,7 @@ export const MultipleRecordPickerCreateTargetSelect = ({
onBack,
onSelect,
}: MultipleRecordPickerCreateTargetSelectProps) => {
+ const { t } = useLingui();
const handleKeyDownCapture = (event: KeyboardEvent<HTMLDivElement>) => {
if (event.key !== Key.Escape || event.nativeEvent.isComposing) {
return;
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerFetchMoreLoader.tsx b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerFetchMoreLoader.tsx
index 86dc6d79c8a..f0e5f55ed5d 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerFetchMoreLoader.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerFetchMoreLoader.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { useDropdownPage } from 'twenty-ui/components/navigation';
import { useMultipleRecordPickerPerformSearch } from '@/object-record/record-picker/multiple-record-picker/hooks/useMultipleRecordPickerPerformSearch';
import { MultipleRecordPickerComponentInstanceContext } from '@/object-record/record-picker/multiple-record-picker/states/contexts/MultipleRecordPickerComponentInstanceContext';
@@ -20,6 +19,7 @@ import { useCallback } from 'react';
import { useInView } from 'react-intersection-observer';
import { useStore } from 'jotai';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledText = styled.div`
align-items: center;
@@ -36,6 +36,7 @@ const StyledIntersectionObserver = styled.div`
`;
export const MultipleRecordPickerFetchMoreLoader = () => {
+ const { t } = useLingui();
const store = useStore();
const { isActive } = useDropdownPage();
const [
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItemContent.tsx b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItemContent.tsx
index a5c3f11c20c..b6eee1f3d33 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItemContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItemContent.tsx
@@ -8,11 +8,11 @@ import { type RecordPickerPickableMorphItem } from '@/object-record/record-picke
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilySelectorValue';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { capitalize } from 'twenty-shared/utils';
import { Avatar } from 'twenty-ui/primitives/data-display';
import { type SearchRecord } from '~/generated/graphql';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
+import { useLingui } from '@lingui/react/macro';
type MultipleRecordPickerMenuItemContentProps = {
searchRecord: SearchRecord;
@@ -25,6 +25,7 @@ export const MultipleRecordPickerMenuItemContent = ({
objectMetadataItem,
onChange,
}: MultipleRecordPickerMenuItemContentProps) => {
+ const { t } = useLingui();
const componentInstanceId = useAvailableComponentInstanceIdOrThrow(
MultipleRecordPickerComponentInstanceContext,
);
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItems.tsx b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItems.tsx
index 0457afe0b76..404ff7c1deb 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItems.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItems.tsx
@@ -13,9 +13,9 @@ import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/com
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { useAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { isNonEmptyArray } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
+import { useLingui } from '@lingui/react/macro';
type MultipleRecordPickerMenuItemsProps = {
onChange?: (morphItem: RecordPickerPickableMorphItem) => void;
@@ -24,6 +24,7 @@ type MultipleRecordPickerMenuItemsProps = {
export const MultipleRecordPickerMenuItems = ({
onChange,
}: MultipleRecordPickerMenuItemsProps) => {
+ const { t } = useLingui();
const componentInstanceId = useAvailableComponentInstanceIdOrThrow(
MultipleRecordPickerComponentInstanceContext,
);
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerSearchInput.tsx b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerSearchInput.tsx
index 1fe4e581754..b0ff9ed26cc 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerSearchInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerSearchInput.tsx
@@ -7,14 +7,15 @@ import { MultipleRecordPickerComponentInstanceContext } from '@/object-record/re
import { multipleRecordPickerPaginationState } from '@/object-record/record-picker/multiple-record-picker/states/multipleRecordPickerPaginationState';
import { multipleRecordPickerSearchFilterComponentState } from '@/object-record/record-picker/multiple-record-picker/states/multipleRecordPickerSearchFilterComponentState';
import { Dropdown, useDropdownPage } from 'twenty-ui/components/navigation';
-import { t } from '@lingui/core/macro';
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentState';
import { useDebouncedCallback } from 'use-debounce';
+import { useLingui } from '@lingui/react/macro';
const SEARCH_DEBOUNCE_DELAY_IN_MILLISECONDS = 500;
export const MultipleRecordPickerSearchInput = () => {
+ const { t } = useLingui();
const componentInstanceId = useAvailableComponentInstanceIdOrThrow(
MultipleRecordPickerComponentInstanceContext,
);
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItemsWithSearch.tsx b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItemsWithSearch.tsx
index 5fd55067d20..cb845d4a66a 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItemsWithSearch.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItemsWithSearch.tsx
@@ -16,8 +16,8 @@ import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownM
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { isDefined } from 'twenty-shared/utils';
-import { t } from '@lingui/core/macro';
import { IconPlus } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const SingleRecordPickerMenuItemsWithSearch = ({
EmptyIcon,
@@ -30,6 +30,7 @@ export const SingleRecordPickerMenuItemsWithSearch = ({
layoutDirection = 'search-bar-on-top',
focusId,
}: SingleRecordPickerMenuItemsWithSearchProps) => {
+ const { t } = useLingui();
const { handleSearchFilterChange } = useSingleRecordPickerSearch();
const recordPickerInstanceId = useAvailableComponentInstanceIdOrThrow(
diff --git a/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetJunctionAddNewRow.tsx b/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetJunctionAddNewRow.tsx
index de6c9556f39..63d2a9d5b85 100644
--- a/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetJunctionAddNewRow.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetJunctionAddNewRow.tsx
@@ -8,12 +8,12 @@ import { RecordTableActionRow } from '@/object-record/record-table/record-table-
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
-import { t } from '@lingui/core/macro';
import { type RecordGqlOperationFilter } from 'twenty-shared/types';
import { useToast } from 'twenty-ui/components/feedback';
import { Dropdown } from 'twenty-ui/components/navigation';
import { IconPlus } from 'twenty-ui/icon';
import { logError } from '~/utils/logError';
+import { useLingui } from '@lingui/react/macro';
type RecordTableWidgetJunctionAddNewRowProps = {
dropdownId: string;
@@ -26,6 +26,7 @@ export const RecordTableWidgetJunctionAddNewRow = ({
junctionCreateThrough,
targetRecordsFilter = junctionCreateThrough.targetRecordsFilter,
}: RecordTableWidgetJunctionAddNewRowProps) => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const { objectMetadataItem: junctionObjectMetadataItem } =
diff --git a/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetNestedRelationAddNewRow.tsx b/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetNestedRelationAddNewRow.tsx
index c4404e6567c..d5ae54cc692 100644
--- a/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetNestedRelationAddNewRow.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetNestedRelationAddNewRow.tsx
@@ -4,9 +4,9 @@ import { type RecordTableWidgetNestedRelationCreateThrough } from '@/object-reco
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
-import { t } from '@lingui/core/macro';
import { Dropdown } from 'twenty-ui/components/navigation';
import { IconPlus } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type RecordTableWidgetNestedRelationAddNewRowProps = {
dropdownId: string;
@@ -18,19 +18,22 @@ export const RecordTableWidgetNestedRelationAddNewRow = ({
dropdownId,
nestedRelationCreateThrough,
onRelationRecordSelected,
-}: RecordTableWidgetNestedRelationAddNewRowProps) => (
- <DropdownRoot dropdownId={dropdownId} type="picker">
- <Dropdown.Trigger render={<div />} nativeButton={false}>
- <RecordTableActionRow LeftIcon={IconPlus} text={t`Add New`} />
- </Dropdown.Trigger>
- <DropdownContent align="start" width={GenericDropdownContentWidth.Medium}>
- <RecordTableWidgetRelationPickerDropdownContent
- objectNameSingular={
- nestedRelationCreateThrough.relationObjectMetadataNameSingular
- }
- recordsFilter={nestedRelationCreateThrough.relationRecordsFilter}
- onRelationRecordSelected={onRelationRecordSelected}
- />
- </DropdownContent>
- </DropdownRoot>
-);
+}: RecordTableWidgetNestedRelationAddNewRowProps) => {
+ const { t } = useLingui();
+ return (
+ <DropdownRoot dropdownId={dropdownId} type="picker">
+ <Dropdown.Trigger render={<div />} nativeButton={false}>
+ <RecordTableActionRow LeftIcon={IconPlus} text={t`Add New`} />
+ </Dropdown.Trigger>
+ <DropdownContent align="start" width={GenericDropdownContentWidth.Medium}>
+ <RecordTableWidgetRelationPickerDropdownContent
+ objectNameSingular={
+ nestedRelationCreateThrough.relationObjectMetadataNameSingular
+ }
+ recordsFilter={nestedRelationCreateThrough.relationRecordsFilter}
+ onRelationRecordSelected={onRelationRecordSelected}
+ />
+ </DropdownContent>
+ </DropdownRoot>
+ );
+};
diff --git a/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetRelationPickerDropdownContent.tsx b/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetRelationPickerDropdownContent.tsx
index 938a16e56fb..1264acb4f65 100644
--- a/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetRelationPickerDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetRelationPickerDropdownContent.tsx
@@ -1,11 +1,11 @@
import { RecordPickerLoadingSkeletonList } from '@/object-record/record-picker/components/RecordPickerLoadingSkeletonList';
import { RecordTableWidgetRelationPickerMenuItem } from '@/object-record/record-table-widget/components/RecordTableWidgetRelationPickerMenuItem';
import { useRecordsForSelect } from '@/object-record/select/hooks/useRecordsForSelect';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { type RecordGqlOperationFilter } from 'twenty-shared/types';
import { isNonEmptyArray } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
+import { useLingui } from '@lingui/react/macro';
type RecordTableWidgetRelationPickerDropdownContentProps = {
objectNameSingular: string;
@@ -18,6 +18,7 @@ export const RecordTableWidgetRelationPickerDropdownContent = ({
recordsFilter,
onRelationRecordSelected,
}: RecordTableWidgetRelationPickerDropdownContentProps) => {
+ const { t } = useLingui();
const [searchFilter, setSearchFilter] = useState('');
const { recordsToSelect, loading } = useRecordsForSelect({
diff --git a/packages/twenty-front/src/modules/object-record/record-table/components/RecordTableNoRecordGroupAddNew.tsx b/packages/twenty-front/src/modules/object-record/record-table/components/RecordTableNoRecordGroupAddNew.tsx
index 285bbd28ad9..8a08382ea6c 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/components/RecordTableNoRecordGroupAddNew.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/components/RecordTableNoRecordGroupAddNew.tsx
@@ -17,13 +17,14 @@ import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/h
import { useStore } from 'jotai';
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { useCallback, useContext } from 'react';
import { type ObjectRecord } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconPlus } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const RecordTableNoRecordGroupAddNew = () => {
+ const { t } = useLingui();
const { objectMetadataItem, recordTableId } = useRecordTableContextOrThrow();
const recordTableWidgetContext = useContext(RecordTableWidgetContext);
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellDisplayContainer.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellDisplayContainer.tsx
index f56d89aff73..fe43a03c128 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellDisplayContainer.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellDisplayContainer.tsx
@@ -1,8 +1,8 @@
import { RECORD_TABLE_CELL_DISPLAY_CLASS_NAME } from '@/object-record/record-table/constants/RecordTableCellDisplayClassName';
-import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { type Ref } from 'react';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledOuterContainer = styled.div`
align-items: center;
@@ -43,22 +43,25 @@ export const RecordTableCellDisplayContainer = ({
scrollRef,
onContextMenu,
placeholderForEmptyCell,
-}: React.PropsWithChildren<EditableCellDisplayContainerProps>) => (
- <StyledOuterContainer
- className={RECORD_TABLE_CELL_DISPLAY_CLASS_NAME}
- data-testid={
- focus ? 'editable-cell-focus-mode' : 'editable-cell-display-mode'
- }
- onClick={onClick}
- ref={scrollRef}
- onContextMenu={onContextMenu}
- >
- {placeholderForEmptyCell ? (
- <StyledEmptyPlaceholderField>
- {t`Set ${placeholderForEmptyCell}`}
- </StyledEmptyPlaceholderField>
- ) : (
- <StyledInnerContainer>{children}</StyledInnerContainer>
- )}
- </StyledOuterContainer>
-);
+}: React.PropsWithChildren<EditableCellDisplayContainerProps>) => {
+ const { t } = useLingui();
+ return (
+ <StyledOuterContainer
+ className={RECORD_TABLE_CELL_DISPLAY_CLASS_NAME}
+ data-testid={
+ focus ? 'editable-cell-focus-mode' : 'editable-cell-display-mode'
+ }
+ onClick={onClick}
+ ref={scrollRef}
+ onContextMenu={onContextMenu}
+ >
+ {placeholderForEmptyCell ? (
+ <StyledEmptyPlaceholderField>
+ {t`Set ${placeholderForEmptyCell}`}
+ </StyledEmptyPlaceholderField>
+ ) : (
+ <StyledInnerContainer>{children}</StyledInnerContainer>
+ )}
+ </StyledOuterContainer>
+ );
+};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellEditButton.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellEditButton.tsx
index d954c745f65..c3736f25e1a 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellEditButton.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellEditButton.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { useGetButtonIcon } from '@/object-record/record-field/ui/hooks/useGetButtonIcon';
import { useIsFieldInputOnly } from '@/object-record/record-field/ui/hooks/useIsFieldInputOnly';
@@ -9,8 +8,10 @@ import { useOpenRecordTableCellFromCell } from '@/object-record/record-table/rec
import { useContext } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconArrowUpRight, IconPencil } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const RecordTableCellEditButton = () => {
+ const { t } = useLingui();
const { columnIndex } = useContext(RecordTableCellContext);
const { openTableCell } = useOpenRecordTableCellFromCell();
const isFieldInputOnly = useIsFieldInputOnly();
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterMenuContent.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterMenuContent.tsx
index e3e568a55a8..f388b63b9c4 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterMenuContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterMenuContent.tsx
@@ -6,12 +6,13 @@ import { PERCENT_AGGREGATE_OPERATION_OPTIONS } from '@/object-record/record-tabl
import { useViewFieldAggregateOperation } from '@/object-record/record-table/record-table-footer/hooks/useViewFieldAggregateOperation';
import { getAvailableAggregateOperationsForFieldMetadataType } from '@/object-record/record-table/record-table-footer/utils/getAvailableAggregateOperationsForFieldMetadataType';
import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
-import { t } from '@lingui/core/macro';
import { useContext, useMemo } from 'react';
import { isDefined, isFieldMetadataDateKind } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
+import { useLingui } from '@lingui/react/macro';
export const RecordTableColumnAggregateFooterMenuContent = () => {
+ const { t } = useLingui();
const { fieldMetadataId, dropdownId, fieldMetadataType } = useContext(
RecordTableColumnAggregateFooterDropdownContext,
);
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderAddColumnButton.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderAddColumnButton.tsx
index 8c377ff017c..f28abc709b3 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderAddColumnButton.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderAddColumnButton.tsx
@@ -19,10 +19,10 @@ import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hoo
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { cx } from '@linaria/core';
-import { t } from '@lingui/core/macro';
import { Dropdown } from 'twenty-ui/components/navigation';
import { IconPlus } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledPlusIconHeaderCell = styled.div<{
shouldDisplayBorderBottom: boolean;
@@ -65,6 +65,7 @@ const StyledDropdownContainer = styled.div`
`;
export const RecordTableHeaderAddColumnButton = () => {
+ const { t } = useLingui();
const theme = useTheme();
const isRecordTableRowActive = useAtomComponentFamilyStateValue(
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderLabelIdentifierCellPlusButton.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderLabelIdentifierCellPlusButton.tsx
index 9177c983cfd..028e47abdf2 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderLabelIdentifierCellPlusButton.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderLabelIdentifierCellPlusButton.tsx
@@ -6,11 +6,11 @@ import { canCreateRecordsForObjectMetadataItem } from '@/object-record/utils/can
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconPlus } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
import { useIsMobile } from 'twenty-ui/utilities';
+import { useLingui } from '@lingui/react/macro';
const StyledHeaderIcon = styled.div`
margin: ${themeCssVariables.spacing[1]} ${themeCssVariables.spacing[1]}
@@ -18,6 +18,7 @@ const StyledHeaderIcon = styled.div`
`;
export const RecordTableHeaderLabelIdentifierCellPlusButton = () => {
+ const { t } = useLingui();
const { objectMetadataItem, objectPermissions } =
useRecordTableContextOrThrow();
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSectionAddNew.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSectionAddNew.tsx
index dc781646c2d..a79882a0a44 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSectionAddNew.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSectionAddNew.tsx
@@ -15,13 +15,14 @@ import { canCreateRecordsForObjectMetadataItem } from '@/object-record/utils/can
import { makeAndFilterVariables } from '@/object-record/utils/makeAndFilterVariables';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { type ObjectRecord } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconPlus } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const RecordTableRecordGroupSectionAddNew = () => {
+ const { t } = useLingui();
const { objectMetadataItem, recordTableId } = useRecordTableContextOrThrow();
const recordTableWidgetContext = useContext(RecordTableWidgetContext);
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSectionLoadMore.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSectionLoadMore.tsx
index 0b6194e1135..3ca8bd1489c 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSectionLoadMore.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSectionLoadMore.tsx
@@ -4,10 +4,11 @@ import { recordIndexHasFetchedAllRecordsByGroupComponentState } from '@/object-r
import { useRecordTableContextOrThrow } from '@/object-record/record-table/contexts/RecordTableContext';
import { RecordTableActionRow } from '@/object-record/record-table/record-table-row/components/RecordTableActionRow';
import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue';
-import { t } from '@lingui/core/macro';
import { IconArrowDown } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const RecordTableRecordGroupSectionLoadMore = () => {
+ const { t } = useLingui();
const { objectNameSingular } = useRecordTableContextOrThrow();
const currentRecordGroupId = useCurrentRecordGroupId();
diff --git a/packages/twenty-front/src/modules/object-record/record-title-cell/components/RecordTitleCellTextFieldDisplay.tsx b/packages/twenty-front/src/modules/object-record/record-title-cell/components/RecordTitleCellTextFieldDisplay.tsx
index c4fd9c16bdc..05c6908899f 100644
--- a/packages/twenty-front/src/modules/object-record/record-title-cell/components/RecordTitleCellTextFieldDisplay.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-title-cell/components/RecordTitleCellTextFieldDisplay.tsx
@@ -5,11 +5,11 @@ import { type RecordTitleCellContainerType } from '@/object-record/record-title-
import { getRecordFieldInputInstanceId } from '@/object-record/utils/getRecordFieldInputId';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useContext } from 'react';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledDiv = styled.div`
align-items: center;
@@ -38,6 +38,7 @@ export const RecordTitleCellSingleTextDisplayMode = ({
}: {
containerType: RecordTitleCellContainerType;
}) => {
+ const { t } = useLingui();
const { recordId, fieldDefinition } = useContext(FieldContext);
const recordStore = useAtomFamilyStateValue(recordStoreFamilyState, recordId);
diff --git a/packages/twenty-front/src/modules/object-record/record-title-cell/components/RecordTitleFullNameFieldDisplay.tsx b/packages/twenty-front/src/modules/object-record/record-title-cell/components/RecordTitleFullNameFieldDisplay.tsx
index 5d316ef29ab..fa083e817d1 100644
--- a/packages/twenty-front/src/modules/object-record/record-title-cell/components/RecordTitleFullNameFieldDisplay.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-title-cell/components/RecordTitleFullNameFieldDisplay.tsx
@@ -5,11 +5,11 @@ import { getRecordFieldInputInstanceId } from '@/object-record/utils/getRecordFi
import { usePushFocusItemToFocusStack } from '@/ui/utilities/focus/hooks/usePushFocusItemToFocusStack';
import { FocusComponentType } from '@/ui/utilities/focus/types/FocusComponentType';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useContext } from 'react';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledDiv = styled.div`
align-items: center;
@@ -38,6 +38,7 @@ export const RecordTitleFullNameFieldDisplay = ({
}: {
containerType: string;
}) => {
+ const { t } = useLingui();
const { recordId, fieldDefinition } = useContext(FieldContext);
const { openRecordTitleCell } = useRecordTitleCell();
diff --git a/packages/twenty-front/src/modules/object-record/select/components/MultipleSelectDropdown.tsx b/packages/twenty-front/src/modules/object-record/select/components/MultipleSelectDropdown.tsx
index aa3d11039cf..a0344c43ada 100644
--- a/packages/twenty-front/src/modules/object-record/select/components/MultipleSelectDropdown.tsx
+++ b/packages/twenty-front/src/modules/object-record/select/components/MultipleSelectDropdown.tsx
@@ -11,7 +11,7 @@ import { useSelectableList } from '@/ui/layout/selectable-list/hooks/useSelectab
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
export const MultipleSelectDropdown = ({
selectableListId,
@@ -34,6 +34,7 @@ export const MultipleSelectDropdown = ({
) => void;
loadingItems: boolean;
}) => {
+ const { t } = useLingui();
const { closeDropdown } = useCloseDropdown();
const { resetSelectedItem } = useSelectableList(selectableListId);
diff --git a/packages/twenty-front/src/modules/object-record/spreadsheet-import/hooks/useBuildSpreadSheetImportFields.ts b/packages/twenty-front/src/modules/object-record/spreadsheet-import/hooks/useBuildSpreadSheetImportFields.ts
index 632dbd2c159..fe6382e2fc9 100644
--- a/packages/twenty-front/src/modules/object-record/spreadsheet-import/hooks/useBuildSpreadSheetImportFields.ts
+++ b/packages/twenty-front/src/modules/object-record/spreadsheet-import/hooks/useBuildSpreadSheetImportFields.ts
@@ -1,5 +1,4 @@
import { getLinksVariant } from '@/object-record/spreadsheet-import/utils/getLinksVariant';
-import { t } from '@lingui/core/macro';
import { objectMetadataItemsSelector } from '@/object-metadata/states/objectMetadataItemsSelector';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
@@ -25,6 +24,7 @@ import {
} from 'twenty-shared/utils';
import { useIcons } from 'twenty-ui/icon/provider';
import { FieldMetadataType, RelationType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const getSourceLocaleAlternateMatches = ({
label,
@@ -36,6 +36,7 @@ const getSourceLocaleAlternateMatches = ({
label === sourceLocaleLabel ? {} : { alternateMatches: [sourceLocaleLabel] };
export const useBuildSpreadsheetImportFields = () => {
+ const { t } = useLingui();
const { getIcon } = useIcons();
const objectMetadataItems = useAtomStateValue(objectMetadataItemsSelector);
diff --git a/packages/twenty-front/src/modules/onboarding/components/import-contacts/OnboardingImportPreviewEmails.tsx b/packages/twenty-front/src/modules/onboarding/components/import-contacts/OnboardingImportPreviewEmails.tsx
index 0c3ec5480ab..753b9bdd9a8 100644
--- a/packages/twenty-front/src/modules/onboarding/components/import-contacts/OnboardingImportPreviewEmails.tsx
+++ b/packages/twenty-front/src/modules/onboarding/components/import-contacts/OnboardingImportPreviewEmails.tsx
@@ -7,11 +7,11 @@ import {
IMPORT_CONTACTS_PREVIEW_EMAILS,
} from '@/onboarding/constants/ImportContactsPreviewEmails';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const EVENT_CARD_WIDTH = 160;
@@ -172,23 +172,26 @@ const EVENT_CARD_POSITIONS: Record<
},
};
-const EmailRow = ({ email }: { email: ImportContactsPreviewEmail }) => (
- <StyledEmailRow>
- <StyledEmailCheckbox data-selected={email.isSelected} />
- <StyledEmailStar data-selected={email.isSelected} />
- <StyledEmailSender
- data-medium={email.isSenderMedium}
- style={{ color: SENDER_COLORS[email.senderColor] }}
- >
- {email.sender}
- </StyledEmailSender>
- {isDefined(email.subject) && (
- <StyledEmailSubject>
- {isString(email.subject) ? email.subject : t(email.subject)}
- </StyledEmailSubject>
- )}
- </StyledEmailRow>
-);
+const EmailRow = ({ email }: { email: ImportContactsPreviewEmail }) => {
+ const { t } = useLingui();
+ return (
+ <StyledEmailRow>
+ <StyledEmailCheckbox data-selected={email.isSelected} />
+ <StyledEmailStar data-selected={email.isSelected} />
+ <StyledEmailSender
+ data-medium={email.isSenderMedium}
+ style={{ color: SENDER_COLORS[email.senderColor] }}
+ >
+ {email.sender}
+ </StyledEmailSender>
+ {isDefined(email.subject) && (
+ <StyledEmailSubject>
+ {isString(email.subject) ? email.subject : t(email.subject)}
+ </StyledEmailSubject>
+ )}
+ </StyledEmailRow>
+ );
+};
const EventCard = ({
event,
diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabMenuItemSelectAvatar.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabMenuItemSelectAvatar.tsx
index 4756f82f26e..a475945472f 100644
--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabMenuItemSelectAvatar.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabMenuItemSelectAvatar.tsx
@@ -1,11 +1,11 @@
import { TabAvatar } from '@/ui/layout/tab-list/components/TabAvatar';
import { type SingleTabProps } from '@/ui/layout/tab-list/types/SingleTabProps';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { DragDropItemSortableHandleRefContext } from '@/ui/utilities/drag-and-drop/context/DragDropItemSortableHandleRefContext';
import { LightIconButton } from 'twenty-ui/components/input';
import { Dropdown } from 'twenty-ui/components/navigation';
import { IconGripVertical, IconPencil } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type PageLayoutTabMenuItemSelectAvatarProps = {
tab: SingleTabProps;
@@ -28,6 +28,7 @@ export const PageLayoutTabMenuItemSelectAvatar = ({
onEditClick,
testId,
}: PageLayoutTabMenuItemSelectAvatarProps) => {
+ const { t } = useLingui();
const handleRef = useContext(DragDropItemSortableHandleRefContext);
return (
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useCreateRecordPageNoteWidget.ts b/packages/twenty-front/src/modules/page-layout/hooks/useCreateRecordPageNoteWidget.ts
index 7817344e02c..4521f6a85a0 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useCreateRecordPageNoteWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useCreateRecordPageNoteWidget.ts
@@ -4,13 +4,14 @@ import { addWidgetToTab } from '@/page-layout/utils/addWidgetToTab';
import { createDefaultStandaloneRichTextWidget } from '@/page-layout/utils/createDefaultStandaloneRichTextWidget';
import { useNavigatePageLayoutSidePanel } from '@/side-panel/pages/page-layout/hooks/useNavigatePageLayoutSidePanel';
import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
-import { t } from '@lingui/core/macro';
import { useStore } from 'jotai';
import { SidePanelPages } from 'twenty-shared/types';
import { PageLayoutTabLayoutMode } from '~/generated-metadata/graphql';
import { v4 as uuidv4 } from 'uuid';
+import { useLingui } from '@lingui/react/macro';
export const useCreateRecordPageNoteWidget = (pageLayoutId?: string) => {
+ const { t } = useLingui();
const { navigatePageLayoutSidePanel } = useNavigatePageLayoutSidePanel();
const pageLayoutDraftState = useAtomComponentStateCallbackState(
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWidgets.ts b/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWidgets.ts
index d27d6eedc9a..a730eddad5d 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWidgets.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWidgets.ts
@@ -3,7 +3,6 @@ import { useUpdateMetadataStoreDraft } from '@/metadata-store/hooks/useUpdateMet
import { type FlatPageLayoutWidget } from '@/metadata-store/types/FlatPageLayoutWidget';
import { useMutation } from '@apollo/client/react';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
-import { t } from '@lingui/core/macro';
import { CrudOperationType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
@@ -11,6 +10,7 @@ import {
type PageLayoutWidgetVerticalListPosition,
UpdatePageLayoutWidgetDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export type PageLayoutWidgetUpdate = {
widgetId: string;
@@ -19,6 +19,7 @@ export type PageLayoutWidgetUpdate = {
};
export const useUpdatePageLayoutWidgets = () => {
+ const { t } = useLingui();
const [updatePageLayoutWidgetMutation] = useMutation(
UpdatePageLayoutWidgetDocument,
);
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWithTabsAndWidgets.ts b/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWithTabsAndWidgets.ts
index 385f16348c6..901d092ddfa 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWithTabsAndWidgets.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWithTabsAndWidgets.ts
@@ -7,11 +7,12 @@ import {
import { useMetadataErrorHandler } from '@/metadata-error-handler/hooks/useMetadataErrorHandler';
import { type MetadataRequestResult } from '@/object-metadata/types/MetadataRequestResult';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
-import { t } from '@lingui/core/macro';
import { CrudOperationType } from 'twenty-shared/types';
import { useToast } from 'twenty-ui/components/feedback';
+import { useLingui } from '@lingui/react/macro';
export const useUpdatePageLayoutWithTabsAndWidgets = () => {
+ const { t } = useLingui();
const [updatePageLayoutWithTabsAndWidgetsMutation] = useMutation(
UpdatePageLayoutWithTabsAndWidgetsDocument,
);
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/CallRecordingSummaryBody.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/CallRecordingSummaryBody.tsx
index 390aa257f03..9d250dc6aca 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/CallRecordingSummaryBody.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/CallRecordingSummaryBody.tsx
@@ -8,9 +8,9 @@ import { PageLayoutWidgetErrorDisplay } from '@/page-layout/widgets/components/P
import { WidgetSkeletonLoader } from '@/page-layout/widgets/components/WidgetSkeletonLoader';
import { useCurrentWidget } from '@/page-layout/widgets/hooks/useCurrentWidget';
import { type WidgetAccessDenialInfo } from '@/page-layout/widgets/types/WidgetAccessDenialInfo';
-import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
const StyledSummaryContainer = styled.div`
display: flex;
@@ -36,6 +36,7 @@ export const CallRecordingSummaryBody = ({
error,
restriction,
}: CallRecordingSummaryBodyProps) => {
+ const { t } = useLingui();
const widget = useCurrentWidget();
if (isDefined(restriction)) {
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/WidgetActionCallRecordingSummary.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/WidgetActionCallRecordingSummary.tsx
index 60a5210dac4..3c1c3440251 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/WidgetActionCallRecordingSummary.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/WidgetActionCallRecordingSummary.tsx
@@ -2,12 +2,13 @@ import { WidgetActionCallRecordingSeeAll } from '@/page-layout/widgets/call-reco
import { useCallRecordingForWidget } from '@/page-layout/widgets/call-recording/hooks/useCallRecordingForWidget';
import { getCallRecordingSummaryMarkdown } from '@/page-layout/widgets/call-recording-summary/utils/getCallRecordingSummaryMarkdown';
import { WidgetCardHeaderActionButton } from '@/page-layout/widgets/widget-card/components/WidgetCardHeaderActionButton';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconCopy } from 'twenty-ui/icon';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
+import { useLingui } from '@lingui/react/macro';
export const WidgetActionCallRecordingSummary = () => {
+ const { t } = useLingui();
const { callRecording, loading, error, restriction } =
useCallRecordingForWidget({ kind: 'summary' });
const { copyToClipboard } = useCopyToClipboard();
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingAudioPlayer.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingAudioPlayer.tsx
index c6755bb1e50..2a0c00f8d87 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingAudioPlayer.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingAudioPlayer.tsx
@@ -1,6 +1,6 @@
import { formatCallRecordingTranscriptTimestamp } from '@/page-layout/widgets/call-recording-transcript/utils/formatCallRecordingTranscriptTimestamp';
import { styled } from '@linaria/react';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { useImperativeHandle, useRef, useState, type Ref } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { Loader } from 'twenty-ui/primitives/feedback';
@@ -12,6 +12,7 @@ import {
import { Button, Slider } from 'twenty-ui/primitives/input';
import { IconButton } from 'twenty-ui/components/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledAudioBar = styled.div`
align-items: center;
@@ -52,6 +53,7 @@ export const CallRecordingAudioPlayer = ({
src,
onRetry,
}: CallRecordingAudioPlayerProps) => {
+ const { t } = useLingui();
const audioElementRef = useRef<HTMLAudioElement>(null);
const [isPlaying, setIsPlaying] = useState(false);
const [currentTimeSeconds, setCurrentTimeSeconds] = useState(0);
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptBody.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptBody.tsx
index cfa861bec90..322dc0bcb34 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptBody.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptBody.tsx
@@ -13,11 +13,11 @@ import { WidgetSkeletonLoader } from '@/page-layout/widgets/components/WidgetSke
import { useCurrentWidget } from '@/page-layout/widgets/hooks/useCurrentWidget';
import { type WidgetAccessDenialInfo } from '@/page-layout/widgets/types/WidgetAccessDenialInfo';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { type CallRecordingParsedTranscriptEntry } from 'twenty-shared/types';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledRecordingLayout = styled.div<{ hasTranscriptEntries: boolean }>`
display: ${({ hasTranscriptEntries }) =>
@@ -56,6 +56,7 @@ export const CallRecordingTranscriptBody = ({
restriction,
refetchCallRecording,
}: CallRecordingTranscriptBodyProps) => {
+ const { t } = useLingui();
const widget = useCurrentWidget();
const [mediaElement, setMediaElement] = useState<HTMLMediaElement | null>(
null,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryList.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryList.tsx
index be6f40804c8..00cddd40d71 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryList.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryList.tsx
@@ -4,7 +4,6 @@ import { type CallRecordingTranscriptPlayback } from '@/page-layout/widgets/call
import { getCallRecordingTranscriptEntryPlaybackPhase } from '@/page-layout/widgets/call-recording-transcript/utils/getCallRecordingTranscriptEntryPlaybackPhase';
import { ScrollOverlayButton } from '@/ui/utilities/scroll/components/ScrollOverlayButton';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import {
useCallback,
useRef,
@@ -16,6 +15,7 @@ import { type CallRecordingParsedTranscriptEntry } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledTranscriptContainer = styled.div`
height: 100%;
@@ -60,6 +60,7 @@ export const CallRecordingTranscriptEntryList = ({
entries,
playback,
}: CallRecordingTranscriptEntryListProps) => {
+ const { t } = useLingui();
const scrollContainerElementRef = useRef<HTMLDivElement>(null);
const activeEntryElementRef = useRef<HTMLLIElement>(null);
const [isFollowingPlayback, setIsFollowingPlayback] = useState(true);
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryListItem.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryListItem.tsx
index 707da5602f1..43e658118c1 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryListItem.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingTranscriptEntryListItem.tsx
@@ -3,12 +3,12 @@ import { CallRecordingTranscriptEntryWords } from '@/page-layout/widgets/call-re
import { type CallRecordingTranscriptEntryPlaybackPhase } from '@/page-layout/widgets/call-recording-transcript/types/CallRecordingTranscriptEntryPlaybackPhase';
import { formatCallRecordingTranscriptTimestamp } from '@/page-layout/widgets/call-recording-transcript/utils/formatCallRecordingTranscriptTimestamp';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type Ref } from 'react';
import { type CallRecordingParsedTranscriptEntry } from 'twenty-shared/types';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { Avatar, Chip } from 'twenty-ui/primitives/data-display';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledEntry = styled.li<{
hasPlaybackControls: boolean;
@@ -90,6 +90,7 @@ export const CallRecordingTranscriptEntryListItem = ({
entryElementRef,
onSelect,
}: CallRecordingTranscriptEntryListItemProps) => {
+ const { t } = useLingui();
const speakerName = entry.speakerName ?? t`Unknown speaker`;
const entryStartSeconds = entry.startSeconds;
const isSelectable = isDefined(entryStartSeconds) && isDefined(onSelect);
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingVideoPlayer.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingVideoPlayer.tsx
index d7f179ce380..72120977d29 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingVideoPlayer.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingVideoPlayer.tsx
@@ -1,9 +1,9 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState, type Ref } from 'react';
import { Loader } from 'twenty-ui/primitives/feedback';
import { Button } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
// Forces Safari to decode the first frame under preload="metadata".
const FIRST_FRAME_SEEK_FRAGMENT = '#t=0.001';
@@ -90,6 +90,7 @@ export const CallRecordingVideoPlayer = ({
src,
onRetry,
}: CallRecordingVideoPlayerProps) => {
+ const { t } = useLingui();
const [loadState, setLoadState] = useState<CallRecordingVideoLoadState>(
'awaiting-first-frame',
);
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/WidgetActionCallRecordingTranscript.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/WidgetActionCallRecordingTranscript.tsx
index dfc3e4a8811..0f0668a2ba0 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/WidgetActionCallRecordingTranscript.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/WidgetActionCallRecordingTranscript.tsx
@@ -3,7 +3,6 @@ import { useCallRecordingForWidget } from '@/page-layout/widgets/call-recording/
import { getCallRecordingPlaybackMedia } from '@/page-layout/widgets/call-recording/utils/getCallRecordingPlaybackMedia';
import { buildCallRecordingTranscriptPlainText } from '@/page-layout/widgets/call-recording-transcript/utils/buildCallRecordingTranscriptPlainText';
import { WidgetCardHeaderActionButton } from '@/page-layout/widgets/widget-card/components/WidgetCardHeaderActionButton';
-import { t } from '@lingui/core/macro';
import { useMemo } from 'react';
import {
isDefined,
@@ -12,8 +11,10 @@ import {
} from 'twenty-shared/utils';
import { IconCopy, IconLink } from 'twenty-ui/icon';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
+import { useLingui } from '@lingui/react/macro';
export const WidgetActionCallRecordingTranscript = () => {
+ const { t } = useLingui();
const { callRecording, loading, error, restriction } =
useCallRecordingForWidget({ kind: 'transcript' });
const { copyToClipboard } = useCopyToClipboard();
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording/components/CallRecordingWidgetUnavailableDisplay.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording/components/CallRecordingWidgetUnavailableDisplay.tsx
index d05549b5be3..3298cbe2898 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording/components/CallRecordingWidgetUnavailableDisplay.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording/components/CallRecordingWidgetUnavailableDisplay.tsx
@@ -1,6 +1,6 @@
import { CallRecordingWidgetEmptyStateDisplay } from '@/page-layout/widgets/call-recording/components/CallRecordingWidgetEmptyStateDisplay';
import { type CallRecordingWidgetUnavailableReason } from '@/page-layout/widgets/call-recording/types/CallRecordingWidgetUnavailableReason';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type CallRecordingWidgetUnavailableDisplayProps = {
reason: CallRecordingWidgetUnavailableReason;
@@ -8,14 +8,17 @@ type CallRecordingWidgetUnavailableDisplayProps = {
export const CallRecordingWidgetUnavailableDisplay = ({
reason,
-}: CallRecordingWidgetUnavailableDisplayProps) => (
- <CallRecordingWidgetEmptyStateDisplay
- animatedPlaceholderType="noWidgets"
- title={t`Call Recording Unavailable`}
- subTitle={
- reason === 'workspaceWithoutCallRecording'
- ? t`Call recording is not available in this workspace.`
- : t`Call recordings are not available on this record.`
- }
- />
-);
+}: CallRecordingWidgetUnavailableDisplayProps) => {
+ const { t } = useLingui();
+ return (
+ <CallRecordingWidgetEmptyStateDisplay
+ animatedPlaceholderType="noWidgets"
+ title={t`Call Recording Unavailable`}
+ subTitle={
+ reason === 'workspaceWithoutCallRecording'
+ ? t`Call recording is not available in this workspace.`
+ : t`Call recordings are not available on this record.`
+ }
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording/components/WidgetActionCallRecordingSeeAll.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording/components/WidgetActionCallRecordingSeeAll.tsx
index f82f7945c8f..b67751ad1ed 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording/components/WidgetActionCallRecordingSeeAll.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording/components/WidgetActionCallRecordingSeeAll.tsx
@@ -3,11 +3,12 @@ import { useCurrentWidget } from '@/page-layout/widgets/hooks/useCurrentWidget';
import { widgetHeaderCountComponentFamilyState } from '@/page-layout/widgets/states/widgetHeaderCountComponentFamilyState';
import { WidgetCardHeaderActionLink } from '@/page-layout/widgets/widget-card/components/WidgetCardHeaderActionLink';
import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconArrowUpRight } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const WidgetActionCallRecordingSeeAll = () => {
+ const { t } = useLingui();
const widget = useCurrentWidget();
const widgetHeaderCount = useAtomComponentFamilyStateValue(
widgetHeaderCountComponentFamilyState,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/chat-threads/components/ChatThreadsCard.tsx b/packages/twenty-front/src/modules/page-layout/widgets/chat-threads/components/ChatThreadsCard.tsx
index e8bc3ec9c2c..4d0576d865b 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/chat-threads/components/ChatThreadsCard.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/chat-threads/components/ChatThreadsCard.tsx
@@ -1,5 +1,3 @@
-import { t } from '@lingui/core/macro';
-
import { useChatThreadsForRecord } from '@/ai/hooks/useChatThreadsForRecord';
import { useDetachChatThreadFromRecord } from '@/ai/hooks/useDetachChatThreadFromRecord';
import { ChatThreadsCardContent } from '@/page-layout/widgets/chat-threads/components/ChatThreadsCardContent';
@@ -7,8 +5,10 @@ import { useTargetRecord } from '@/ui/layout/contexts/useTargetRecord';
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
import { useToast } from 'twenty-ui/components/feedback';
import { Button } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
export const ChatThreadsCard = () => {
+ const { t } = useLingui();
const targetRecord = useTargetRecord();
const {
threads,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/chat-threads/components/ChatThreadsCardContent.tsx b/packages/twenty-front/src/modules/page-layout/widgets/chat-threads/components/ChatThreadsCardContent.tsx
index 5998576a4ff..eabf73787c1 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/chat-threads/components/ChatThreadsCardContent.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/chat-threads/components/ChatThreadsCardContent.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
@@ -18,6 +17,7 @@ import { isSidePanelOpenedState } from '@/side-panel/states/isSidePanelOpenedSta
import { EmptyState } from '@/ui/feedback/empty-state/components/EmptyState';
import { ErrorState } from '@/ui/feedback/empty-state/components/ErrorState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import { useLingui } from '@lingui/react/macro';
const StyledThreadsContainer = styled.div`
display: flex;
@@ -48,6 +48,7 @@ export const ChatThreadsCardContent = ({
hasNextPage = false,
pagination,
}: ChatThreadsCardContentProps) => {
+ const { t } = useLingui();
const { openRecordInSidePanel } = useOpenRecordInSidePanel();
const isSidePanelOpened = useAtomStateValue(isSidePanelOpenedState);
const sidePanelRoutedPath = useCurrentSidePanelRoutedPath();
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/DashboardWidgetPlaceholder.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/DashboardWidgetPlaceholder.tsx
index e043d19b719..a39b9a68731 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/DashboardWidgetPlaceholder.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/DashboardWidgetPlaceholder.tsx
@@ -9,11 +9,11 @@ import { AnimatedPlaceholder } from '@/ui/feedback/empty-state/components/Animat
import { EmptyState } from '@/ui/feedback/empty-state/components/EmptyState';
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
-import { Trans } from '@lingui/react/macro';
+import { Trans, useLingui } from '@lingui/react/macro';
import { SidePanelPages } from 'twenty-shared/types';
export const DashboardWidgetPlaceholder = () => {
+ const { t } = useLingui();
const pageLayoutId = useAvailableComponentInstanceIdOrThrow(
PageLayoutComponentInstanceContext,
);
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetErrorDisplay.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetErrorDisplay.tsx
index c4eb3f83ffe..d4a93cf7e99 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetErrorDisplay.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetErrorDisplay.tsx
@@ -1,8 +1,8 @@
import { PageLayoutWidgetForbiddenDisplay } from '@/page-layout/widgets/components/PageLayoutWidgetForbiddenDisplay';
import { PageLayoutWidgetStatusDisplay } from '@/page-layout/widgets/components/PageLayoutWidgetStatusDisplay';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isGraphqlErrorOfType } from '~/utils/is-graphql-error-of-type.util';
+import { useLingui } from '@lingui/react/macro';
const StyledForbiddenContainer = styled.div`
align-items: center;
@@ -19,6 +19,7 @@ export const PageLayoutWidgetErrorDisplay = ({
widgetId,
error,
}: PageLayoutWidgetErrorDisplayProps) => {
+ const { t } = useLingui();
if (isGraphqlErrorOfType(error, 'FORBIDDEN')) {
return (
<StyledForbiddenContainer>
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetForbiddenDisplay.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetForbiddenDisplay.tsx
index ef3fcaa0dd3..cf452a8504c 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetForbiddenDisplay.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetForbiddenDisplay.tsx
@@ -1,9 +1,10 @@
import { ForbiddenFieldDisplay } from '@/object-record/record-field/ui/meta-types/display/components/ForbiddenFieldDisplay';
import { type WidgetAccessDenialInfo } from '@/page-layout/widgets/types/WidgetAccessDenialInfo';
import { TooltipDelay } from '@/ui/layout/tooltip/constants/TooltipDelay';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { Tooltip } from 'twenty-ui/primitives/surfaces';
+import { useLingui } from '@lingui/react/macro';
type PageLayoutWidgetForbiddenDisplayProps = {
widgetId: string;
@@ -14,6 +15,7 @@ export const PageLayoutWidgetForbiddenDisplay = ({
widgetId,
restriction,
}: PageLayoutWidgetForbiddenDisplayProps) => {
+ const { t } = useLingui();
const tooltipId = `widget-forbidden-tooltip-${widgetId}`;
const getTooltipContent = () => {
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetInvalidConfigDisplay.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetInvalidConfigDisplay.tsx
index 30c7df5c035..3fb79d3fb5b 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetInvalidConfigDisplay.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetInvalidConfigDisplay.tsx
@@ -1,10 +1,10 @@
import { useCurrentWidget } from '@/page-layout/widgets/hooks/useCurrentWidget';
import { TooltipDelay } from '@/ui/layout/tooltip/constants/TooltipDelay';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type FallbackProps } from 'react-error-boundary';
import { Status } from 'twenty-ui/primitives/data-display';
import { Tooltip } from 'twenty-ui/primitives/surfaces';
+import { useLingui } from '@lingui/react/macro';
type PageLayoutWidgetInvalidConfigDisplayProps = FallbackProps;
@@ -17,6 +17,7 @@ const StyledInvalidConfigContainer = styled.div`
export const PageLayoutWidgetInvalidConfigDisplay = ({
error,
}: PageLayoutWidgetInvalidConfigDisplayProps) => {
+ const { t } = useLingui();
const widget = useCurrentWidget();
const tooltipId = `widget-invalid-config-tooltip-${widget.id}`;
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetNoDataDisplay.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetNoDataDisplay.tsx
index 350b99bc486..d041cedf6e8 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetNoDataDisplay.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetNoDataDisplay.tsx
@@ -1,9 +1,10 @@
import { PageLayoutWidgetStatusDisplay } from '@/page-layout/widgets/components/PageLayoutWidgetStatusDisplay';
import { useCurrentWidget } from '@/page-layout/widgets/hooks/useCurrentWidget';
-import { t } from '@lingui/core/macro';
import { WidgetType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const PageLayoutWidgetNoDataDisplay = () => {
+ const { t } = useLingui();
const widget = useCurrentWidget();
const text = widget.type === WidgetType.IFRAME ? t`Invalid URL` : t`No Data`;
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/RecordPageAddWidgetSection.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/RecordPageAddWidgetSection.tsx
index 9198de7974c..8028780a545 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/RecordPageAddWidgetSection.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/RecordPageAddWidgetSection.tsx
@@ -8,7 +8,6 @@ import { useNavigateToMoreWidgets } from '@/page-layout/hooks/useNavigateToMoreW
import { type WidgetInsertionContext } from '@/page-layout/states/widgetInsertionContextComponentState';
import { type PageLayoutWidget } from '@/page-layout/types/PageLayoutWidget';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { ListItemButton } from 'twenty-ui/components/navigation';
import {
IconListDetails,
@@ -17,6 +16,7 @@ import {
IconPlus,
} from 'twenty-ui/icon';
import { themeCssVariables, useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
border: 1px solid transparent;
@@ -55,6 +55,7 @@ type RecordPageAddWidgetSectionProps = {
export const RecordPageAddWidgetSection = ({
insertionContext = null,
}: RecordPageAddWidgetSectionProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const { tabId } = usePageLayoutContentContext();
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/RecordPageWidgetInsertionSeparator.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/RecordPageWidgetInsertionSeparator.tsx
index 32e2ccc2dba..17cdf6bd529 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/RecordPageWidgetInsertionSeparator.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/RecordPageWidgetInsertionSeparator.tsx
@@ -2,10 +2,10 @@ import { useNavigateToMoreWidgets } from '@/page-layout/hooks/useNavigateToMoreW
import { type PageLayoutWidget } from '@/page-layout/types/PageLayoutWidget';
import { css } from '@linaria/core';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { IconButton } from 'twenty-ui/components/input';
import { IconPlus } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const INSERT_BUTTON_CLASS_NAME = css`
opacity: 0;
@@ -66,6 +66,7 @@ type RecordPageWidgetInsertionSeparatorProps = {
export const RecordPageWidgetInsertionSeparator = ({
widget,
}: RecordPageWidgetInsertionSeparatorProps) => {
+ const { t } = useLingui();
const { navigateToMoreWidgets } = useNavigateToMoreWidgets();
return (
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetActionFieldSeeAll.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetActionFieldSeeAll.tsx
index 41d1362e597..269190be3e8 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetActionFieldSeeAll.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetActionFieldSeeAll.tsx
@@ -4,9 +4,9 @@ import { useFieldWidgetFieldDefinition } from '@/page-layout/widgets/field/hooks
import { useFieldWidgetRelationSeeAllHref } from '@/page-layout/widgets/field/hooks/useFieldWidgetRelationSeeAllHref';
import { WidgetCardHeaderActionLink } from '@/page-layout/widgets/widget-card/components/WidgetCardHeaderActionLink';
import { useTargetRecord } from '@/ui/layout/contexts/useTargetRecord';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconArrowUpRight } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type WidgetActionFieldSeeAllProps = {
widget: PageLayoutWidget;
@@ -15,6 +15,7 @@ type WidgetActionFieldSeeAllProps = {
export const WidgetActionFieldSeeAll = ({
widget,
}: WidgetActionFieldSeeAllProps) => {
+ const { t } = useLingui();
const targetRecord = useTargetRecord();
const { fieldDefinition } = useFieldWidgetFieldDefinition(widget);
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/EmailThreadComposer.tsx b/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/EmailThreadComposer.tsx
index 3d645c6da21..1ffdd0fda71 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/EmailThreadComposer.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/EmailThreadComposer.tsx
@@ -10,7 +10,6 @@ import { SIDE_PANEL_FOCUS_ID } from '@/side-panel/constants/SidePanelFocusId';
import { useOpenRecordInSidePanel } from '@/side-panel/hooks/useOpenRecordInSidePanel';
import { type SidePanelFooterCommandMenuItem } from '@/ui/layout/side-panel/types/SidePanelFooterCommandMenuItem';
import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';
-import { t } from '@lingui/core/macro';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import {
@@ -20,6 +19,7 @@ import {
IconX,
} from 'twenty-ui/icon';
import { LightButton } from 'twenty-ui/components/input';
+import { useLingui } from '@lingui/react/macro';
type EmailThreadComposerProps = {
replyContext: ReplyContextReady;
@@ -36,6 +36,7 @@ export const EmailThreadComposer = ({
setIsComposerOpen,
draftPrefill,
}: EmailThreadComposerProps) => {
+ const { t } = useLingui();
const { openRecordInSidePanel } = useOpenRecordInSidePanel();
const handleReplySent = useCallback(
@@ -114,6 +115,7 @@ export const EmailThreadComposer = ({
canSendReply,
setIsComposerOpen,
openAttachmentPicker,
+ t,
]);
const handleSendHotkey = useCallback(() => {
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/EmailThreadIntermediaryMessages.tsx b/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/EmailThreadIntermediaryMessages.tsx
index 3f4d89e797a..4a75d983714 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/EmailThreadIntermediaryMessages.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/EmailThreadIntermediaryMessages.tsx
@@ -3,10 +3,10 @@ import { useState } from 'react';
import { EmailThreadMessage } from '@/activities/emails/components/EmailThreadMessage';
import { type EmailThreadMessageWithSender } from '@/activities/emails/types/EmailThreadMessageWithSender';
-import { t } from '@lingui/core/macro';
import { IconArrowsVertical } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledButtonContainer = styled.div`
border-bottom: 1px solid ${themeCssVariables.border.color.light};
@@ -20,6 +20,7 @@ export const EmailThreadIntermediaryMessages = ({
messages: EmailThreadMessageWithSender[];
onDraftClick: (message: EmailThreadMessageWithSender) => void;
}) => {
+ const { t } = useLingui();
const [areMessagesOpen, setAreMessagesOpen] = useState(false);
const messagesLength = messages.length;
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/MessageThreadWidget.tsx b/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/MessageThreadWidget.tsx
index f47d5943361..8c1191bac86 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/MessageThreadWidget.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/MessageThreadWidget.tsx
@@ -13,8 +13,8 @@ import {
StyledWidgetScrollContainer,
} from '@/ui/layout/components/WidgetContentContainer';
import { useTargetRecord } from '@/ui/layout/contexts/useTargetRecord';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
type MessageThreadWidgetProps = {
widget: PageLayoutWidget;
@@ -23,6 +23,7 @@ type MessageThreadWidgetProps = {
export const MessageThreadWidget = ({
widget: _widget,
}: MessageThreadWidgetProps) => {
+ const { t } = useLingui();
const targetRecord = useTargetRecord();
const {
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidget.tsx b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidget.tsx
index 2e6522f12c2..3dca26e97d2 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidget.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidget.tsx
@@ -37,10 +37,10 @@ import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/use
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { isNonEmptyString } from '@sniptt/guards';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { FieldDisplayMode } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
box-sizing: border-box;
@@ -52,6 +52,7 @@ type FieldWidgetProps = {
};
export const FieldWidget = ({ widget }: FieldWidgetProps) => {
+ const { t } = useLingui();
assertFieldWidgetOrThrow(widget);
const targetRecord = useTargetRecord();
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetEditAction.tsx b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetEditAction.tsx
index 05b0ca3d39f..1f48124b00a 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetEditAction.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetEditAction.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { FieldContext } from '@/object-record/record-field/ui/contexts/FieldContext';
@@ -7,8 +6,10 @@ import { useOpenFieldWidgetFieldInputEditMode } from '@/page-layout/widgets/fiel
import { WidgetCardHeaderHoverReveal } from '@/page-layout/widgets/widget-card/components/WidgetCardHeaderHoverReveal';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconPencil } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const FieldWidgetEditAction = () => {
+ const { t } = useLingui();
const { recordId, fieldDefinition } = useContext(FieldContext);
const { openInlineCell } = useInlineCell();
const { openFieldInput } = useOpenFieldWidgetFieldInputEditMode();
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetRelationEditAction.tsx b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetRelationEditAction.tsx
index 8e677f5729e..18a8414b4b8 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetRelationEditAction.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetRelationEditAction.tsx
@@ -19,12 +19,12 @@ import { isFieldMorphRelation } from '@/object-record/record-field/ui/types/guar
import { recordStoreFamilySelector } from '@/object-record/record-store/states/selectors/recordStoreFamilySelector';
import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilySelectorValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { CustomError, isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
import { IconPencil, IconPlus } from 'twenty-ui/icon';
import { IconButton } from 'twenty-ui/components/input';
import { RelationType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type FieldWidgetRelationEditActionProps = {
fieldDefinition:
@@ -42,6 +42,7 @@ export const FieldWidgetRelationEditAction = ({
fieldDefinition,
recordId,
}: FieldWidgetRelationEditActionProps) => {
+ const { t } = useLingui();
const { objectMetadataItems } = useObjectMetadataItems();
const objectMetadataItem = objectMetadataItems.find(
(item) =>
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetShowMoreButton.tsx b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetShowMoreButton.tsx
index a688500701e..cf5a4d781d3 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetShowMoreButton.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetShowMoreButton.tsx
@@ -1,6 +1,6 @@
-import { t } from '@lingui/core/macro';
import { LightButton } from 'twenty-ui/components/input';
import { IconChevronDown } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type FieldWidgetShowMoreButtonProps = {
remainingCount: number;
@@ -10,14 +10,17 @@ type FieldWidgetShowMoreButtonProps = {
export const FieldWidgetShowMoreButton = ({
remainingCount,
onClick,
-}: FieldWidgetShowMoreButtonProps) => (
- <LightButton
- emphasis="subtle"
- size="sm"
- startIcon={<IconChevronDown />}
- data-testid="field-widget-show-more-button"
- onClick={onClick}
- >
- {t`More (${remainingCount})`}
- </LightButton>
-);
+}: FieldWidgetShowMoreButtonProps) => {
+ const { t } = useLingui();
+ return (
+ <LightButton
+ emphasis="subtle"
+ size="sm"
+ startIcon={<IconChevronDown />}
+ data-testid="field-widget-show-more-button"
+ onClick={onClick}
+ >
+ {t`More (${remainingCount})`}
+ </LightButton>
+ );
+};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationFieldEditor.tsx b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationFieldEditor.tsx
index 88e8f9f4b96..d51462534e8 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationFieldEditor.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationFieldEditor.tsx
@@ -2,10 +2,10 @@ import { DraggableListRow } from '@/ui/layout/draggable-list/components/Draggabl
import { ApplicationStackIcon } from '@/applications/components/ApplicationStackIcon';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { type FieldsConfigurationFieldItem } from '@/page-layout/types/FieldsConfiguration';
-import { t } from '@lingui/core/macro';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconEye, IconEyeOff } from 'twenty-ui/icon';
import { useIcons } from 'twenty-ui/icon/provider';
+import { useLingui } from '@lingui/react/macro';
type FieldsConfigurationFieldEditorProps = {
field: FieldsConfigurationFieldItem;
@@ -18,6 +18,7 @@ export const FieldsConfigurationFieldEditor = ({
fieldMetadata,
onToggleVisibility,
}: FieldsConfigurationFieldEditorProps) => {
+ const { t } = useLingui();
const { getIcon } = useIcons();
const isVisible = field.isVisible ?? true;
const FieldIcon = getIcon(fieldMetadata.icon);
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidget.tsx b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidget.tsx
index 9489c0c90dd..188d7ea43d5 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidget.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidget.tsx
@@ -15,10 +15,9 @@ import { useTargetRecord } from '@/ui/layout/contexts/useTargetRecord';
import { useWorkspaceSurface } from '@/ui/layout/hooks/useWorkspaceSurface';
import { SidePanelProvider } from '@/ui/layout/side-panel/contexts/SidePanelContext';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
import { themeCssVariables } from 'twenty-ui/theme';
import { type FieldsConfiguration } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledPropertyBox = styled.div`
align-self: stretch;
@@ -48,6 +47,7 @@ type FieldsWidgetProps = {
};
export const FieldsWidget = ({ widget }: FieldsWidgetProps) => {
+ const { t } = useLingui();
const targetRecord = useTargetRecord();
const isInSidePanel = useWorkspaceSurface().type === 'side-panel';
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/components/GraphWidgetLegend.tsx b/packages/twenty-front/src/modules/page-layout/widgets/graph/components/GraphWidgetLegend.tsx
index 631e65467d5..c00b963c0e8 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/graph/components/GraphWidgetLegend.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/graph/components/GraphWidgetLegend.tsx
@@ -11,13 +11,13 @@ import { NodeDimensionEffect } from '@/ui/utilities/dimensions/components/NodeDi
import { useAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentState';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { AnimatePresence, motion } from 'framer-motion';
import { useRef, useState } from 'react';
import { LightIconButton } from 'twenty-ui/components/input';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { IconChevronLeft, IconChevronRight } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
export type GraphWidgetLegendItem = {
id: string;
@@ -136,6 +136,7 @@ export const GraphWidgetLegend = ({
items,
show = true,
}: GraphWidgetLegendProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const containerRef = useRef<HTMLDivElement>(null);
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/components/GraphWidgetTooltip.tsx b/packages/twenty-front/src/modules/page-layout/widgets/graph/components/GraphWidgetTooltip.tsx
index 82cb2d71256..a4257a17097 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/graph/components/GraphWidgetTooltip.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/graph/components/GraphWidgetTooltip.tsx
@@ -3,11 +3,11 @@ import { GRAPH_TOOLTIP_MIN_WIDTH_PX } from '@/page-layout/widgets/graph/componen
import { GRAPH_TOOLTIP_SCROLL_MAX_HEIGHT_PX } from '@/page-layout/widgets/graph/components/constants/GraphTooltipScrollMaxHeightPx';
import { GraphWidgetLegendDot } from '@/page-layout/widgets/graph/components/GraphWidgetLegendDot';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { IconArrowUpRight } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledTooltip = styled.div`
background: ${themeCssVariables.background.primary};
@@ -152,6 +152,7 @@ export const GraphWidgetTooltip = ({
highlightedKey,
onGraphWidgetTooltipClick,
}: GraphWidgetTooltipProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const filteredItems = items.filter(
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/graph-widget-pie-chart/hooks/usePieChartCenterMetricData.ts b/packages/twenty-front/src/modules/page-layout/widgets/graph/graph-widget-pie-chart/hooks/usePieChartCenterMetricData.ts
index 48070ffebb5..e3430354bc9 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/graph/graph-widget-pie-chart/hooks/usePieChartCenterMetricData.ts
+++ b/packages/twenty-front/src/modules/page-layout/widgets/graph/graph-widget-pie-chart/hooks/usePieChartCenterMetricData.ts
@@ -10,12 +10,12 @@ import { CHART_NUMBER_FORMAT_DEFAULT } from '@/page-layout/widgets/graph/constan
import { useGraphWidgetQueryCommon } from '@/page-layout/widgets/graph/hooks/useGraphWidgetQueryCommon';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { UserContext } from '@/users/contexts/UserContext';
-import { t } from '@lingui/core/macro';
import { useContext, useMemo } from 'react';
import { FIELD_FOR_TOTAL_COUNT_AGGREGATE_OPERATION } from 'twenty-shared/constants';
import { findById, isDefined } from 'twenty-shared/utils';
import { type PieChartConfiguration } from '~/generated-metadata/graphql';
import { dateLocaleState } from '@/localization/states/dateLocaleState';
+import { useLingui } from '@lingui/react/macro';
type UsePieChartCenterMetricDataProps = {
objectMetadataItemId: string;
@@ -33,6 +33,7 @@ export const usePieChartCenterMetricData = ({
configuration,
skip,
}: UsePieChartCenterMetricDataProps): UsePieChartCenterMetricDataResult => {
+ const { t } = useLingui();
const { objectMetadataItem } = useObjectMetadataItemById({
objectId: objectMetadataItemId,
});
@@ -117,7 +118,7 @@ export const usePieChartCenterMetricData = ({
}
return getAggregateOperationLabel(centerMetricAggregateOperation);
- }, [centerMetricAggregateOperation]);
+ }, [centerMetricAggregateOperation, t]);
const centerMetricValue = useMemo(() => {
if (!isDefined(aggregateFieldMetadataItem)) {
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/hooks/useGraphWidgetAggregateQuery.ts b/packages/twenty-front/src/modules/page-layout/widgets/graph/hooks/useGraphWidgetAggregateQuery.ts
index d7139cd9569..ba4543899d5 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/graph/hooks/useGraphWidgetAggregateQuery.ts
+++ b/packages/twenty-front/src/modules/page-layout/widgets/graph/hooks/useGraphWidgetAggregateQuery.ts
@@ -10,12 +10,12 @@ import { computeRatioDisplayValue } from '@/page-layout/widgets/graph/graph-widg
import { useGraphWidgetQueryCommon } from '@/page-layout/widgets/graph/hooks/useGraphWidgetQueryCommon';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { UserContext } from '@/users/contexts/UserContext';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { FIELD_FOR_TOTAL_COUNT_AGGREGATE_OPERATION } from 'twenty-shared/constants';
import { isDefined } from 'twenty-shared/utils';
import { type AggregateChartConfiguration } from '~/generated-metadata/graphql';
import { dateLocaleState } from '@/localization/states/dateLocaleState';
+import { useLingui } from '@lingui/react/macro';
export const useGraphWidgetAggregateQuery = ({
objectMetadataItemId,
@@ -24,6 +24,7 @@ export const useGraphWidgetAggregateQuery = ({
objectMetadataItemId: string;
configuration: AggregateChartConfiguration;
}) => {
+ const { t } = useLingui();
const { objectMetadataItem, gqlOperationFilter, aggregateField } =
useGraphWidgetQueryCommon({
objectMetadataItemId,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/hooks/useWidgetPermissions.ts b/packages/twenty-front/src/modules/page-layout/widgets/hooks/useWidgetPermissions.ts
index cc14b2446da..eb6869dc9ca 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/hooks/useWidgetPermissions.ts
+++ b/packages/twenty-front/src/modules/page-layout/widgets/hooks/useWidgetPermissions.ts
@@ -5,8 +5,8 @@ import { useObjectPermissions } from '@/object-record/hooks/useObjectPermissions
import { type PageLayoutWidget } from '@/page-layout/types/PageLayoutWidget';
import { extractFieldMetadataIdsFromWidget } from '@/page-layout/utils/extractFieldMetadataIdsFromWidget';
import { type WidgetAccessDenialInfo } from '@/page-layout/widgets/types/WidgetAccessDenialInfo';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
export type UseWidgetPermissionsReturn = {
hasAccess: boolean;
@@ -16,6 +16,7 @@ export type UseWidgetPermissionsReturn = {
export const useWidgetPermissions = (
widget: PageLayoutWidget,
): UseWidgetPermissionsReturn => {
+ const { t } = useLingui();
const { objectPermissionsByObjectMetadataId } = useObjectPermissions();
const { objectMetadataItems } = useObjectMetadataItems();
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/standalone-rich-text/components/StandaloneRichTextEditorContent.tsx b/packages/twenty-front/src/modules/page-layout/widgets/standalone-rich-text/components/StandaloneRichTextEditorContent.tsx
index c7ea7ad71c1..d8c48408abf 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/standalone-rich-text/components/StandaloneRichTextEditorContent.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/standalone-rich-text/components/StandaloneRichTextEditorContent.tsx
@@ -17,13 +17,13 @@ import { useRemoveFocusItemFromFocusStackById } from '@/ui/utilities/focus/hooks
import { FocusComponentType } from '@/ui/utilities/focus/types/FocusComponentType';
import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type Editor } from '@tiptap/core';
import { useStore } from 'jotai';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
import { useDebouncedCallback } from 'use-debounce';
import { WidgetConfigurationType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledEditorContainer = styled.div<{ isEditable: boolean }>`
box-sizing: border-box;
@@ -50,6 +50,7 @@ export const StandaloneRichTextEditorContent = ({
shouldFocus,
containerElement,
}: StandaloneRichTextEditorContentProps) => {
+ const { t } = useLingui();
const { updatePageLayoutWidget } = useUpdatePageLayoutWidget();
const { pushFocusItemToFocusStack } = usePushFocusItemToFocusStack();
const { removeFocusItemFromFocusStackById } =
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/timeline/components/WidgetActionTimelineCreateRelated.tsx b/packages/twenty-front/src/modules/page-layout/widgets/timeline/components/WidgetActionTimelineCreateRelated.tsx
index 70de0ef7a01..52bf19ef1ad 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/timeline/components/WidgetActionTimelineCreateRelated.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/timeline/components/WidgetActionTimelineCreateRelated.tsx
@@ -2,10 +2,11 @@ import { useRelatedRecordActions } from '@/activities/hooks/useRelatedRecordActi
import { WidgetCardHeaderActionButton } from '@/page-layout/widgets/widget-card/components/WidgetCardHeaderActionButton';
import { useOpenCreateRelatedRecordInSidePanel } from '@/side-panel/hooks/useOpenCreateRelatedRecordInSidePanel';
import { useTargetRecord } from '@/ui/layout/contexts/useTargetRecord';
-import { t } from '@lingui/core/macro';
import { IconPlus } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const WidgetActionTimelineCreateRelated = () => {
+ const { t } = useLingui();
const targetRecord = useTargetRecord();
const hasAnyRelatedRecordAction = useRelatedRecordActions({
targetRecord,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeader.tsx b/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeader.tsx
index e3b3462d104..1b118135469 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeader.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeader.tsx
@@ -4,7 +4,6 @@ import { widgetHeaderCountComponentFamilyState } from '@/page-layout/widgets/sta
import { WidgetCardHeaderActionsRenderer } from '@/page-layout/widgets/widget-card/components/WidgetCardHeaderActionsRenderer';
import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { IconButton } from 'twenty-ui/components/input';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
@@ -15,6 +14,8 @@ import { WidgetGrip } from '@/page-layout/widgets/widget-card/components/WidgetG
import { AnimatePresence, motion } from 'framer-motion';
import { isDefined } from 'twenty-shared/utils';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
+
export type WidgetCardHeaderProps = {
variant: WidgetCardVariant;
widgetId: string;
@@ -86,6 +87,7 @@ export const WidgetCardHeader = ({
forbiddenDisplay,
className,
}: WidgetCardHeaderProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const { formatNumber } = useNumberFormat();
const widgetCardHovered = useAtomComponentFamilyStateValue(
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistTable.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistTable.tsx
index 361cbeceea6..07ab5b391b3 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistTable.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistTable.tsx
@@ -5,8 +5,8 @@ import { TableBody } from '@/ui/layout/table/components/TableBody';
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SettingsAccountsBlocklistTableProps = {
blocklist: BlocklistItem[];
@@ -25,6 +25,7 @@ export const SettingsAccountsBlocklistTable = ({
blocklist,
handleBlockedEmailRemove,
}: SettingsAccountsBlocklistTableProps) => {
+ const { t } = useLingui();
return (
<>
{blocklist.length > 0 && (
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistTableRow.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistTableRow.tsx
index f55326c54e8..7787cee6134 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistTableRow.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistTableRow.tsx
@@ -1,12 +1,12 @@
import { type BlocklistItem } from '@/accounts/types/BlocklistItem';
import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableRow } from '@/ui/layout/table/components/TableRow';
-import { t } from '@lingui/core/macro';
import { IconButton } from 'twenty-ui/components/input';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { IconX } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
import { formatToHumanReadableDate } from '~/utils/date-utils';
+import { useLingui } from '@lingui/react/macro';
type SettingsAccountsBlocklistTableRowProps = {
blocklistItem: BlocklistItem;
@@ -17,6 +17,7 @@ export const SettingsAccountsBlocklistTableRow = ({
blocklistItem,
onRemove,
}: SettingsAccountsBlocklistTableRowProps) => {
+ const { t } = useLingui();
return (
<TableRow
key={blocklistItem.id}
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx
index 4b1111a4ebc..5ed92415450 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx
@@ -4,12 +4,12 @@ import { useMutation } from '@apollo/client/react';
import { SettingsAccountsEventVisibilitySettingsCard } from '@/settings/accounts/components/SettingsAccountsCalendarVisibilitySettingsCard';
import { SettingsOptionCardContentSwitch } from '@/settings/components/SettingsOptions/SettingsOptionCardContentSwitch';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Section } from 'twenty-ui/components/layout';
import { IconEyeOff, IconUserPlus } from 'twenty-ui/icon';
import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
import { type CalendarChannelVisibility } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledDetailsContainer = styled.div`
display: flex;
@@ -31,6 +31,7 @@ type SettingsAccountsCalendarChannelDetailsProps = {
export const SettingsAccountsCalendarChannelDetails = ({
calendarChannel,
}: SettingsAccountsCalendarChannelDetailsProps) => {
+ const { t } = useLingui();
const [updateMetadataChannel] = useMutation(UPDATE_CALENDAR_CHANNEL);
const updateChannel = (update: Record<string, unknown>) => {
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx
index 7f432cee727..4d3f742e020 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx
@@ -1,7 +1,5 @@
import { useMutation } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
import {
type MessageChannelContactAutoCreationPolicy,
MessageChannelType,
@@ -19,6 +17,7 @@ import { SettingsAccountsMessageVisibilityCard } from '@/settings/accounts/compo
import { UPDATE_MESSAGE_CHANNEL } from '@/settings/accounts/graphql/mutations/updateMessageChannel';
import { SettingsOptionCardContentSwitch } from '@/settings/components/SettingsOptions/SettingsOptionCardContentSwitch';
import { type MessageChannelVisibility } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type SettingsAccountsMessageChannelDetailsProps = {
messageChannel: Pick<
@@ -51,6 +50,7 @@ const StyledDetailsContainer = styled.div`
export const SettingsAccountsMessageChannelDetails = ({
messageChannel,
}: SettingsAccountsMessageChannelDetailsProps) => {
+ const { t } = useLingui();
const [updateMessageChannel] = useMutation(UPDATE_MESSAGE_CHANNEL);
const updateChannel = (update: MessageChannelUpdateInput) => {
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsNewAccountSection.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsNewAccountSection.tsx
index 7788933b0bf..17f48f2ca88 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsNewAccountSection.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsNewAccountSection.tsx
@@ -1,8 +1,9 @@
import { SettingsAccountsListEmptyStateCard } from '@/settings/accounts/components/SettingsAccountsListEmptyStateCard';
-import { t } from '@lingui/core/macro';
import { Section } from 'twenty-ui/components/layout';
+import { useLingui } from '@lingui/react/macro';
export const SettingsNewAccountSection = () => {
+ const { t } = useLingui();
return (
<Section.Root>
<Section.Header
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/message-folders/SettingsMessageFoldersEmptyStateCard.tsx b/packages/twenty-front/src/modules/settings/accounts/components/message-folders/SettingsMessageFoldersEmptyStateCard.tsx
index 5f80692b266..69cffdc4d5f 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/message-folders/SettingsMessageFoldersEmptyStateCard.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/message-folders/SettingsMessageFoldersEmptyStateCard.tsx
@@ -1,8 +1,8 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Section } from 'twenty-ui/components/layout';
import { IconFolder } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledEmptyState = styled.div`
align-items: center;
@@ -15,6 +15,7 @@ const StyledEmptyState = styled.div`
`;
export const SettingsMessageFoldersEmptyStateCard = () => {
+ const { t } = useLingui();
const theme = useTheme();
return (
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx b/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx
index 584f208c6df..f2e2af4d2c5 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx
@@ -3,7 +3,6 @@ import { useToast } from 'twenty-ui/components/feedback';
import { Section } from 'twenty-ui/components/layout';
import { useMutation, useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { AI_MODEL_TIERS, type AiModelTier } from 'twenty-shared/ai';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
@@ -46,6 +45,7 @@ import {
AiModelTier as GraphqlAiModelTier,
} from '~/generated-admin/graphql';
import { OrganizationAdornment } from '@/settings/enterprise/components/OrganizationAdornment';
+import { useLingui } from '@lingui/react/macro';
const USAGE_TABLE_GRID_TEMPLATE_COLUMNS = '1fr 120px';
@@ -56,6 +56,7 @@ type UsageBreakdownItem = {
};
export const SettingsAdminAI = () => {
+ const { t } = useLingui();
const apolloAdminClient = useApolloAdminClient();
const { enqueueToast } = useToast();
const { refetch: refetchClientConfig } = useClientConfig();
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/apps/components/SettingsAdminApps.tsx b/packages/twenty-front/src/modules/settings/admin-panel/apps/components/SettingsAdminApps.tsx
index 4cf50248849..cc8470147f7 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/apps/components/SettingsAdminApps.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/apps/components/SettingsAdminApps.tsx
@@ -11,7 +11,7 @@ import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { useMutation, useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { msg, t } from '@lingui/core/macro';
+import { msg } from '@lingui/core/macro';
import { type MessageDescriptor } from '@lingui/core';
import { isString } from '@sniptt/guards';
import { useState } from 'react';
@@ -40,6 +40,7 @@ import {
SyncMarketplaceCatalogDocument,
} from '~/generated-admin/graphql';
import { SettingsSearchFilterTrigger } from '@/settings/components/SettingsSearchFilterTrigger';
+import { useLingui } from '@lingui/react/macro';
type AdminApplicationRegistration =
FindAllApplicationRegistrationsQuery['findAllApplicationRegistrations']['registrations'][number];
@@ -79,6 +80,7 @@ const SOURCE_TYPE_FILTER_OPTIONS: {
];
export const SettingsAdminApps = () => {
+ const { t } = useLingui();
const apolloAdminClient = useApolloAdminClient();
const { enqueueToast } = useToast();
const [searchQuery, setSearchQuery] = useState('');
@@ -322,6 +324,7 @@ type SettingsAdminAppsTableRowProps = {
const SettingsAdminAppsTableRow = ({
registration,
}: SettingsAdminAppsTableRowProps) => {
+ const { t } = useLingui();
const theme = useTheme();
return (
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatAskQuestionsQuestion.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatAskQuestionsQuestion.tsx
index 1e6acd6d132..94bc040a46a 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatAskQuestionsQuestion.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatAskQuestionsQuestion.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { isNonEmptyString } from '@sniptt/guards';
@@ -9,6 +8,7 @@ import { IconCheck } from 'twenty-ui/icon';
import { themeCssVariables, useTheme } from 'twenty-ui/theme';
import { TextWithChatReferences } from '@/ai/components/TextWithChatReferences';
+import { useLingui } from '@lingui/react/macro';
type SettingsAdminChatAskQuestionsQuestionProps = {
question: AskQuestionItem;
@@ -86,6 +86,7 @@ export const SettingsAdminChatAskQuestionsQuestion = ({
question,
answer,
}: SettingsAdminChatAskQuestionsQuestionProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const selectedOptionIndices = new Set(answer?.selectedOptionIndices ?? []);
const freeText = answer?.freeText ?? '';
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatMessage.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatMessage.tsx
index cd22a00985f..f671bf4f12c 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatMessage.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatMessage.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { themeCssVariables } from 'twenty-ui/theme';
@@ -8,6 +7,7 @@ import { SettingsAdminChatMessagePartRenderer } from '@/settings/admin-panel/com
import { type AdminChatThreadMessage } from '@/settings/admin-panel/types/AdminChatThreadMessage';
import { isRenderableAdminChatMessagePart } from '@/settings/admin-panel/utils/isRenderableAdminChatMessagePart';
import { AgentMessageRole } from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
type SettingsAdminChatMessageProps = {
message: AdminChatThreadMessage;
@@ -36,6 +36,7 @@ const StyledTimestamp = styled.span`
export const SettingsAdminChatMessage = ({
message,
}: SettingsAdminChatMessageProps) => {
+ const { t } = useLingui();
const isUser = message.role === AgentMessageRole.USER;
const isContext = message.role === AgentMessageRole.SYSTEM;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatMessagePartRenderer.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatMessagePartRenderer.tsx
index 5bcc6394dde..ae79ec81e95 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatMessagePartRenderer.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatMessagePartRenderer.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { isNonEmptyString } from '@sniptt/guards';
@@ -11,6 +10,7 @@ import { SettingsAdminChatCollapsibleSection } from '@/settings/admin-panel/comp
import { SettingsAdminChatToolCallPart } from '@/settings/admin-panel/components/SettingsAdminChatToolCallPart';
import { type AdminChatThreadMessagePart } from '@/settings/admin-panel/types/AdminChatThreadMessagePart';
import { parseAdminAskQuestionsResult } from '@/settings/admin-panel/utils/parseAdminAskQuestionsResult';
+import { useLingui } from '@lingui/react/macro';
type SettingsAdminChatMessagePartRendererProps = {
part: AdminChatThreadMessagePart;
@@ -52,6 +52,7 @@ export const SettingsAdminChatMessagePartRenderer = ({
part,
isUserMessage,
}: SettingsAdminChatMessagePartRendererProps) => {
+ const { t } = useLingui();
if (part.type === 'text' && isNonEmptyString(part.textContent)) {
return (
<StyledTextContent isUser={isUserMessage}>
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatThreadMessageList.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatThreadMessageList.tsx
index 26636b31faa..0786304cefb 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatThreadMessageList.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatThreadMessageList.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { TableCell } from '@/ui/layout/table/components/TableCell';
@@ -11,6 +10,7 @@ import { ChatReferenceNavigationEnabledContext } from '@/ai/contexts/ChatReferen
import { SettingsAdminChatMessage } from '@/settings/admin-panel/components/SettingsAdminChatMessage';
import { type AdminChatThreadMessage } from '@/settings/admin-panel/types/AdminChatThreadMessage';
import { isRenderableAdminChatMessagePart } from '@/settings/admin-panel/utils/isRenderableAdminChatMessagePart';
+import { useLingui } from '@lingui/react/macro';
type SettingsAdminChatThreadMessageListProps = {
messages: AdminChatThreadMessage[];
@@ -25,6 +25,7 @@ const StyledMessagesContainer = styled.div`
export const SettingsAdminChatThreadMessageList = ({
messages,
}: SettingsAdminChatThreadMessageListProps) => {
+ const { t } = useLingui();
const visibleMessages = messages.filter((message) =>
message.parts.some(isRenderableAdminChatMessagePart),
);
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatToolCallPart.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatToolCallPart.tsx
index d366f1e237a..d23807453fd 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatToolCallPart.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatToolCallPart.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { isNonEmptyString } from '@sniptt/guards';
@@ -15,6 +14,7 @@ import { type AdminChatThreadMessagePart } from '@/settings/admin-panel/types/Ad
import { getAdminToolDisplayName } from '@/settings/admin-panel/utils/getAdminToolDisplayName';
import { parseAdminToolJson } from '@/settings/admin-panel/utils/parseAdminToolJson';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
+import { useLingui } from '@lingui/react/macro';
type SettingsAdminChatToolCallPartProps = {
part: AdminChatThreadMessagePart;
@@ -85,6 +85,7 @@ const StyledEmptyTabLabel = styled.div`
export const SettingsAdminChatToolCallPart = ({
part,
}: SettingsAdminChatToolCallPartProps) => {
+ const { t } = useLingui();
const [isExpanded, setIsExpanded] = useState(false);
const [activeTab, setActiveTab] = useState<'output' | 'input'>(
isDefined(part.toolOutput) ? 'output' : 'input',
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminGeneral.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminGeneral.tsx
index 6c4a71e77a6..f1ad280e332 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminGeneral.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminGeneral.tsx
@@ -17,7 +17,6 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { getWorkspaceAvatarColorSeed } from '@/workspace/utils/getWorkspaceAvatarColorSeed';
import { useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
@@ -34,6 +33,7 @@ import {
AdminPanelTopWorkspacesDocument,
} from '~/generated-admin/graphql';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
+import { useLingui } from '@lingui/react/macro';
const StyledEmptyState = styled.div`
color: ${themeCssVariables.font.color.tertiary};
@@ -48,6 +48,7 @@ const RECENT_USERS_GRID_TEMPLATE_COLUMNS = '1fr 2fr 1fr 36px';
const TOP_WORKSPACES_GRID_TEMPLATE_COLUMNS = '2fr 1fr 36px';
export const SettingsAdminGeneral = () => {
+ const { t } = useLingui();
const theme = useTheme();
const { formatNumber } = useNumberFormat();
const apolloAdminClient = useApolloAdminClient();
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
index fc09d360ba2..8eb8cc5f2d2 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
@@ -9,7 +9,6 @@ import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation, useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { OTPInput } from 'input-otp';
import { useState } from 'react';
import { useToast } from 'twenty-ui/components/feedback';
@@ -22,6 +21,7 @@ import {
GetServerAdminsDocument,
UpdateServerAdminAccessDocument,
} from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
type ServerAdminAccessUpdate = {
canAccessFullAdminPanel?: boolean;
@@ -74,6 +74,7 @@ export const SettingsAdminServerAdminAccess = ({
userId: string;
userLabel: string;
}) => {
+ const { t } = useLingui();
const dropdownId = `server-admin-access-${userId}`;
const apolloAdminClient = useApolloAdminClient();
const { openDialog } = useDialog();
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdmins.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdmins.tsx
index dddb853f67e..d0d88372889 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdmins.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdmins.tsx
@@ -7,7 +7,6 @@ import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
@@ -15,6 +14,7 @@ import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { IconChevronRight } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { GetServerAdminsDocument } from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
const SERVER_ADMINS_GRID_TEMPLATE_COLUMNS = '1fr 2fr 1fr 36px';
@@ -24,6 +24,7 @@ const StyledEmptyState = styled.div`
`;
export const SettingsAdminServerAdmins = () => {
+ const { t } = useLingui();
const theme = useTheme();
const apolloAdminClient = useApolloAdminClient();
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminTwoFactorAuthenticationRecoveryCode.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminTwoFactorAuthenticationRecoveryCode.tsx
index e1559076ad6..dedddb1d168 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminTwoFactorAuthenticationRecoveryCode.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminTwoFactorAuthenticationRecoveryCode.tsx
@@ -6,13 +6,13 @@ import { useGeneratedRecoveryCode } from '@/settings/two-factor-authentication/h
import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
import { useMutation } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
import { IconKey } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { GenerateTwoFactorAuthenticationRecoveryCodeAsServerAdminDocument } from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledRecoveryCodeContainer = styled.div`
width: 100%;
@@ -29,6 +29,7 @@ export const SettingsAdminTwoFactorAuthenticationRecoveryCode = ({
workspaceId,
memberName,
}: SettingsAdminTwoFactorAuthenticationRecoveryCodeProps) => {
+ const { t } = useLingui();
const dialogId = `admin-two-factor-authentication-recovery-code-${userId}-${workspaceId}`;
const apolloAdminClient = useApolloAdminClient();
const { openDialog } = useDialog();
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminUserWorkspaceActions.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminUserWorkspaceActions.tsx
index b78808cc92b..e7cd72fe064 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminUserWorkspaceActions.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminUserWorkspaceActions.tsx
@@ -4,11 +4,11 @@ import { useHandleImpersonate } from '@/settings/admin-panel/hooks/useHandleImpe
import { type WorkspaceInfo } from '@/settings/admin-panel/types/WorkspaceInfo';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconEyeShare } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledActionRow = styled.div`
column-gap: ${themeCssVariables.spacing[2]};
@@ -28,6 +28,7 @@ export const SettingsAdminUserWorkspaceActions = ({
workspace,
memberName,
}: SettingsAdminUserWorkspaceActionsProps) => {
+ const { t } = useLingui();
const currentUser = useAtomStateValue(currentUserState);
const { handleImpersonate, impersonatingUserId } = useHandleImpersonate();
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminVersionContainer.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminVersionContainer.tsx
index 8435360f74a..588e68273d2 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminVersionContainer.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminVersionContainer.tsx
@@ -1,12 +1,13 @@
import { SettingsTableCard } from '@/settings/components/SettingsTableCard';
import { useApolloAdminClient } from '@/settings/admin-panel/apollo/hooks/useApolloAdminClient';
import { SettingsAdminVersionDisplay } from '@/settings/admin-panel/components/SettingsAdminVersionDisplay';
-import { t } from '@lingui/core/macro';
import { IconCircleDot, IconVersions } from 'twenty-ui/icon';
import { useQuery } from '@apollo/client/react';
import { GetVersionInfoDocument } from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
export const SettingsAdminVersionContainer = () => {
+ const { t } = useLingui();
const apolloAdminClient = useApolloAdminClient();
const { data, loading } = useQuery(GetVersionInfoDocument, {
client: apolloAdminClient,
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminVersionDisplay.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminVersionDisplay.tsx
index 71c12019f79..6cdb16e94f2 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminVersionDisplay.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminVersionDisplay.tsx
@@ -1,6 +1,6 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SettingsAdminVersionDisplayProps = {
version: string | undefined | null;
@@ -26,6 +26,7 @@ export const SettingsAdminVersionDisplay = ({
loading,
noVersionMessage,
}: SettingsAdminVersionDisplayProps) => {
+ const { t } = useLingui();
if (loading) {
return <StyledSpan>{t`Loading...`}</StyledSpan>;
}
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantRowDropdownMenu.tsx
index f5a7b8bd6b7..acf9c1ef2fe 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantRowDropdownMenu.tsx
@@ -1,9 +1,9 @@
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
-import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components/input';
import { Dropdown } from 'twenty-ui/components/navigation';
+import { useLingui } from '@lingui/react/macro';
type SettingsAdminWorkspaceCreditGrantRowDropdownMenuProps = {
creditGrantId: string;
@@ -14,6 +14,7 @@ export const SettingsAdminWorkspaceCreditGrantRowDropdownMenu = ({
creditGrantId,
onRevoke,
}: SettingsAdminWorkspaceCreditGrantRowDropdownMenuProps) => {
+ const { t } = useLingui();
const dropdownId = `settings-admin-credit-grant-row-${creditGrantId}`;
return (
<DropdownRoot type="menu" dropdownId={dropdownId}>
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableDatabaseInput.tsx b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableDatabaseInput.tsx
index 74b152df0f7..38c38d8ac68 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableDatabaseInput.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableDatabaseInput.tsx
@@ -6,7 +6,6 @@ import { TextInput } from '@/ui/input/components/TextInput';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type ConfigVariableValue } from 'twenty-shared/types';
import { CustomError, isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
@@ -14,6 +13,7 @@ import { Dropdown } from 'twenty-ui/components/navigation';
import { CodeEditor } from 'twenty-ui/components/code-editor';
import { themeCssVariables } from 'twenty-ui/theme';
import { ConfigVariableType } from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledJsonEditorContainer = styled.div`
display: flex;
@@ -48,6 +48,7 @@ export const ConfigVariableDatabaseInput = ({
disabled,
placeholder,
}: ConfigVariableDatabaseInputProps) => {
+ const { t } = useLingui();
const selectOptions =
options && Array.isArray(options)
? options.map((option) => ({
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableFilterDropdown.tsx b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableFilterDropdown.tsx
index 6b38a804ef5..17c658e9d06 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableFilterDropdown.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableFilterDropdown.tsx
@@ -2,11 +2,11 @@ import { type ConfigVariableGroupFilter } from '@/settings/admin-panel/config-va
import { type ConfigVariableSourceFilter } from '@/settings/admin-panel/config-variables/types/ConfigVariableSourceFilter';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
-import { t } from '@lingui/core/macro';
import { Dropdown } from 'twenty-ui/components/navigation';
import { IconSettings } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { ConfigVariableOptionsDropdownContent } from './ConfigVariableOptionsDropdownContent';
+import { useLingui } from '@lingui/react/macro';
type ConfigVariableFilterDropdownProps = {
sourceFilter: ConfigVariableSourceFilter;
@@ -27,6 +27,7 @@ export const ConfigVariableFilterDropdown = ({
onGroupFilterChange,
onShowHiddenChange,
}: ConfigVariableFilterDropdownProps) => {
+ const { t } = useLingui();
return (
<DropdownRoot dropdownId="env-var-options-dropdown" type="picker">
<Dropdown.Trigger
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableOptionsDropdownContent.tsx b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableOptionsDropdownContent.tsx
index 8b31e917dfc..caf7d492706 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableOptionsDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableOptionsDropdownContent.tsx
@@ -3,7 +3,6 @@ import { CONFIG_VARIABLE_SOURCE_OPTIONS } from '@/settings/admin-panel/config-va
import { type ConfigVariableGroupFilter } from '@/settings/admin-panel/config-variables/types/ConfigVariableGroupFilter';
import { type ConfigVariableSourceFilter } from '@/settings/admin-panel/config-variables/types/ConfigVariableSourceFilter';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { useLingui } from '@lingui/react/macro';
import { Dropdown, useDropdownPage } from 'twenty-ui/components/navigation';
import { IconEye, IconEyeOff } from 'twenty-ui/icon';
@@ -28,6 +27,7 @@ export const ConfigVariableOptionsDropdownContent = ({
onGroupFilterChange,
onShowHiddenChange,
}: ConfigVariableOptionsDropdownContentProps) => {
+ const { t } = useLingui();
const { goBack } = useDropdownPage();
const { i18n } = useLingui();
const isConfigVariablesInDbEnabled = useAtomStateValue(
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableSearchInput.tsx b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableSearchInput.tsx
index 8a7a0b05176..c75053ce0a8 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableSearchInput.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableSearchInput.tsx
@@ -1,5 +1,5 @@
-import { t } from '@lingui/core/macro';
import { SearchInput } from 'twenty-ui/components/input';
+import { useLingui } from '@lingui/react/macro';
type ConfigVariableSearchInputProps = {
value: string;
@@ -10,6 +10,7 @@ export const ConfigVariableSearchInput = ({
value,
onChange,
}: ConfigVariableSearchInputProps) => {
+ const { t } = useLingui();
return (
<SearchInput
placeholder={t`Search config variables`}
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariables.tsx b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariables.tsx
index e130e9ced29..d5f4911347e 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariables.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariables.tsx
@@ -8,7 +8,6 @@ import { configVariableGroupFilterState } from '@/settings/admin-panel/config-va
import { configVariableSourceFilterState } from '@/settings/admin-panel/config-variables/states/configVariableSourceFilterState';
import { showHiddenGroupVariablesState } from '@/settings/admin-panel/config-variables/states/showHiddenGroupVariablesState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useLingui } from '@lingui/react/macro';
import { useMemo, useState } from 'react';
import { useQuery } from '@apollo/client/react';
@@ -32,6 +31,7 @@ const StyledTableContainer = styled.div`
`;
export const SettingsAdminConfigVariables = () => {
+ const { t } = useLingui();
const { i18n } = useLingui();
const apolloAdminClient = useApolloAdminClient();
const { data: configVariables, loading: configVariablesLoading } = useQuery(
@@ -64,7 +64,7 @@ export const SettingsAdminConfigVariables = () => {
label: group.name,
})),
],
- [allGroups],
+ [allGroups, t],
);
const allVariables = useMemo(
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminConnectedAccountHealthStatus.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminConnectedAccountHealthStatus.tsx
index 5fc2b8252a9..4420f8e4a4c 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminConnectedAccountHealthStatus.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminConnectedAccountHealthStatus.tsx
@@ -1,10 +1,10 @@
import { SettingsAdminHealthAccountSyncCountersTable } from '@/settings/admin-panel/health-status/components/SettingsAdminHealthAccountSyncCountersTable';
import { SettingsAdminIndicatorHealthContext } from '@/settings/admin-panel/health-status/contexts/SettingsAdminIndicatorHealthContext';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { themeCssVariables } from 'twenty-ui/theme';
import { AdminPanelHealthServiceStatus } from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledErrorMessage = styled.div`
color: ${themeCssVariables.color.red};
@@ -18,6 +18,7 @@ const StyledContainer = styled.div`
`;
export const SettingsAdminConnectedAccountHealthStatus = () => {
+ const { t } = useLingui();
const { indicatorHealth } = useContext(SettingsAdminIndicatorHealthContext);
const details = indicatorHealth.details;
if (!details) {
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminDeleteJobsConfirmationModal.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminDeleteJobsConfirmationModal.tsx
index 1aaaf952334..1469e866168 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminDeleteJobsConfirmationModal.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminDeleteJobsConfirmationModal.tsx
@@ -1,5 +1,6 @@
import { ConfirmationDialog } from '@/ui/layout/dialog/components/ConfirmationDialog';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type SettingsAdminDeleteJobsConfirmationModalProps = {
modalInstanceId: string;
@@ -14,6 +15,7 @@ export const SettingsAdminDeleteJobsConfirmationModal = ({
onConfirm,
onClose,
}: SettingsAdminDeleteJobsConfirmationModalProps) => {
+ const { t } = useLingui();
const title = plural(jobCount, {
one: `Delete ${jobCount} Job`,
other: `Delete ${jobCount} Jobs`,
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatus.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatus.tsx
index 1d2f0547c01..720b6951985 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatus.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatus.tsx
@@ -6,14 +6,15 @@ import { SettingsAdminMaintenanceModeFetchEffect } from '@/settings/admin-panel/
import { SettingsAdminSigningKeysTable } from '@/settings/admin-panel/signing-keys/components/SettingsAdminSigningKeysTable';
import { SettingsSectionSkeletonLoader } from '@/settings/components/SettingsSectionSkeletonLoader';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import {
GetInstanceAndAllWorkspacesUpgradeStatusDocument,
GetSystemHealthStatusDocument,
} from '~/generated-admin/graphql';
import { Section } from 'twenty-ui/components/layout';
+import { useLingui } from '@lingui/react/macro';
export const SettingsAdminHealthStatus = () => {
+ const { t } = useLingui();
const apolloAdminClient = useApolloAdminClient();
const { data, loading: loadingHealthStatus } = useQuery(
GetSystemHealthStatusDocument,
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatusRightContainer.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatusRightContainer.tsx
index a6b325e451e..5db16d19aac 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatusRightContainer.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatusRightContainer.tsx
@@ -1,12 +1,13 @@
-import { t } from '@lingui/core/macro';
import { Status } from 'twenty-ui/primitives/data-display';
import { AdminPanelHealthServiceStatus } from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
export const SettingsAdminHealthStatusRightContainer = ({
status,
}: {
status: AdminPanelHealthServiceStatus;
}) => {
+ const { t } = useLingui();
return (
<>
{status === AdminPanelHealthServiceStatus.OPERATIONAL && (
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
index 69739dd933b..c293ea11a87 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
@@ -1,10 +1,10 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { JsonTree } from 'twenty-ui/components/data-display';
import { Collapsible } from 'twenty-ui/primitives/layout';
import { themeCssVariables } from 'twenty-ui/theme';
import { type QueueJob } from '~/generated-admin/graphql';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
+import { useLingui } from '@lingui/react/macro';
type SettingsAdminJobDetailsExpandableProps = {
job: QueueJob;
@@ -61,6 +61,7 @@ export const SettingsAdminJobDetailsExpandable = ({
job,
isExpanded,
}: SettingsAdminJobDetailsExpandableProps) => {
+ const { t } = useLingui();
const { copyToClipboard } = useCopyToClipboard();
const hasData = job.data && Object.keys(job.data).length > 0;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx
index 945efb115d6..53892792171 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx
@@ -1,11 +1,11 @@
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
-import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconRefresh, IconTrash } from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components/input';
import { Dropdown } from 'twenty-ui/components/navigation';
import { isDefined } from 'twenty-shared/utils';
import { JobState } from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
type SettingsAdminQueueJobRowDropdownMenuProps = {
jobId: string;
@@ -20,6 +20,7 @@ export const SettingsAdminQueueJobRowDropdownMenu = ({
onRetry,
onDelete,
}: SettingsAdminQueueJobRowDropdownMenuProps) => {
+ const { t } = useLingui();
const dropdownId = `queue-job-row-${jobId}`;
return (
<DropdownRoot type="menu" dropdownId={dropdownId}>
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobsTable.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobsTable.tsx
index e0b29bc70ab..4cd1d98e49d 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobsTable.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobsTable.tsx
@@ -15,7 +15,7 @@ import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { styled } from '@linaria/react';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { useState } from 'react';
import { IconRefresh, IconTrash } from 'twenty-ui/icon';
import { Button, Checkbox } from 'twenty-ui/primitives/input';
@@ -27,6 +27,7 @@ import {
GetQueueJobsDocument,
} from '~/generated-admin/graphql';
import { beautifyPastDateRelativeToNow } from '~/utils/date-utils';
+import { useLingui } from '@lingui/react/macro';
type SettingsAdminQueueJobsTableProps = {
queueName: string;
@@ -77,6 +78,7 @@ export const SettingsAdminQueueJobsTable = ({
queueName,
onRetentionConfigLoaded,
}: SettingsAdminQueueJobsTableProps) => {
+ const { t } = useLingui();
const apolloAdminClient = useApolloAdminClient();
const [page, setPage] = useState(0);
const [stateFilter, setStateFilter] = useState<JobState>(JobState.COMPLETED);
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminRetryJobsConfirmationModal.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminRetryJobsConfirmationModal.tsx
index 0fe26d93a52..0594adb175b 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminRetryJobsConfirmationModal.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminRetryJobsConfirmationModal.tsx
@@ -1,5 +1,6 @@
import { ConfirmationDialog } from '@/ui/layout/dialog/components/ConfirmationDialog';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type SettingsAdminRetryJobsConfirmationModalProps = {
modalInstanceId: string;
@@ -14,6 +15,7 @@ export const SettingsAdminRetryJobsConfirmationModal = ({
onConfirm,
onClose,
}: SettingsAdminRetryJobsConfirmationModalProps) => {
+ const { t } = useLingui();
const title = plural(jobCount, {
one: `Retry ${jobCount} Job`,
other: `Retry ${jobCount} Jobs`,
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminUpgradeStatusListCard.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminUpgradeStatusListCard.tsx
index 5ce45aef180..b809227298e 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminUpgradeStatusListCard.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminUpgradeStatusListCard.tsx
@@ -1,6 +1,5 @@
import { SettingsAdminUpgradeStatusRightContainer } from '@/settings/admin-panel/health-status/components/SettingsAdminUpgradeStatusRightContainer';
import { SettingsListCard } from '@/settings/components/SettingsListCard';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import {
@@ -10,6 +9,7 @@ import {
type IconComponent,
} from 'twenty-ui/icon';
import { type GetInstanceAndAllWorkspacesUpgradeStatusQuery } from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
type InstanceAndAllWorkspacesUpgradeStatus =
GetInstanceAndAllWorkspacesUpgradeStatusQuery['getInstanceAndAllWorkspacesUpgradeStatus'];
@@ -51,6 +51,7 @@ type SettingsAdminUpgradeStatusListCardProps = {
export const SettingsAdminUpgradeStatusListCard = ({
upgradeStatus,
}: SettingsAdminUpgradeStatusListCardProps) => {
+ const { t } = useLingui();
const sharedRowProps = {
inferredVersion: upgradeStatus.instanceUpgradeStatus.inferredVersion,
instanceHealth: upgradeStatus.instanceUpgradeStatus.health,
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminUpgradeStatusRightContainer.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminUpgradeStatusRightContainer.tsx
index c253294782d..dea975fa755 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminUpgradeStatusRightContainer.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminUpgradeStatusRightContainer.tsx
@@ -2,14 +2,15 @@ import { type UpgradeStatusRow } from '@/settings/admin-panel/health-status/comp
import { getUpgradeHealthStatusBadge } from '@/settings/admin-panel/utils/getUpgradeHealthStatusBadge';
import { getWorkspacesUpgradeHealth } from '@/settings/admin-panel/utils/getWorkspacesUpgradeHealth';
import { getWorkspacesUpgradeHealthText } from '@/settings/admin-panel/utils/getWorkspacesUpgradeHealthText';
-import { t } from '@lingui/core/macro';
import { Status } from 'twenty-ui/primitives/data-display';
+import { useLingui } from '@lingui/react/macro';
export const SettingsAdminUpgradeStatusRightContainer = ({
item,
}: {
item: UpgradeStatusRow;
}) => {
+ const { t } = useLingui();
if (item.kind === 'inferred-version') {
return (
<Status color="gray" weight="medium">
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerHealthStatus.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerHealthStatus.tsx
index 2ac0a92907c..2db123d8546 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerHealthStatus.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerHealthStatus.tsx
@@ -1,10 +1,10 @@
import { SettingsAdminWorkerQueueMetricsSection } from '@/settings/admin-panel/health-status/components/SettingsAdminWorkerQueueMetricsSection';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { AdminPanelHealthServiceStatus } from '~/generated-admin/graphql';
import { SettingsAdminIndicatorHealthContext } from '@/settings/admin-panel/health-status/contexts/SettingsAdminIndicatorHealthContext';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledErrorMessage = styled.div`
color: ${themeCssVariables.color.red};
@@ -12,6 +12,7 @@ const StyledErrorMessage = styled.div`
`;
export const SettingsAdminWorkerHealthStatus = () => {
+ const { t } = useLingui();
const { indicatorHealth } = useContext(SettingsAdminIndicatorHealthContext);
const isWorkerDown =
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsGraph.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsGraph.tsx
index fa4fc2eb17b..9eb48482155 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsGraph.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsGraph.tsx
@@ -4,7 +4,6 @@ import { SettingsAdminWorkerMetricsTooltip } from '@/settings/admin-panel/health
import { SettingsTableCard } from '@/settings/components/SettingsTableCard';
import { useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { ResponsiveLine } from '@nivo/line';
import { capitalize, isDefined } from 'twenty-shared/utils';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
@@ -12,6 +11,7 @@ import {
GetQueueMetricsDocument,
QueueMetricsTimeRange,
} from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledGraphContainer = styled.div`
background-color: ${themeCssVariables.background.secondary};
@@ -46,6 +46,7 @@ export const SettingsAdminWorkerMetricsGraph = ({
queueName,
timeRange,
}: SettingsAdminWorkerMetricsGraphProps) => {
+ const { t } = useLingui();
const apolloAdminClient = useApolloAdminClient();
const theme = useTheme();
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerQueueMetricsSection.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerQueueMetricsSection.tsx
index 9ea28e0c588..d5233dd7480 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerQueueMetricsSection.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerQueueMetricsSection.tsx
@@ -4,7 +4,6 @@ import { WidgetSkeletonLoader } from '@/page-layout/widgets/components/WidgetSke
import { WORKER_QUEUE_METRICS_SELECT_OPTIONS } from '@/settings/admin-panel/health-status/constants/WorkerQueueMetricsSelectOptions';
import { Select } from '@/ui/input/components/Select';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { lazy, Suspense, useState } from 'react';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
@@ -15,6 +14,7 @@ import {
type AdminPanelWorkerQueueHealth,
QueueMetricsTimeRange,
} from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
const SettingsAdminWorkerMetricsGraph = lazy(() =>
import('./SettingsAdminWorkerMetricsGraph').then((module) => ({
@@ -47,6 +47,7 @@ const StyledContainer = styled.div`
export const SettingsAdminWorkerQueueMetricsSection = ({
queue,
}: SettingsAdminWorkerQueueMetricsSectionProps) => {
+ const { t } = useLingui();
const [timeRange, setTimeRange] = useState(QueueMetricsTimeRange.OneHour);
return (
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkspacesByHealthAccordion.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkspacesByHealthAccordion.tsx
index 297ca43275f..e8e917669e9 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkspacesByHealthAccordion.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkspacesByHealthAccordion.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { Link } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
@@ -9,6 +8,7 @@ import { Collapsible } from 'twenty-ui/primitives/layout';
import { ListItem } from 'twenty-ui/primitives/navigation';
import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledAccordionHeader = styled(Card.Content)`
align-items: center;
@@ -50,6 +50,7 @@ export const SettingsAdminWorkspacesByHealthAccordion = ({
workspaces,
defaultExpanded = false,
}: SettingsAdminWorkspacesByHealthAccordionProps) => {
+ const { t } = useLingui();
const [isExpanded, setIsExpanded] = useState(defaultExpanded);
if (workspaces.length === 0) {
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkspacesStatusSummaryCard.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkspacesStatusSummaryCard.tsx
index aa327cdca54..93131cca1b8 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkspacesStatusSummaryCard.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkspacesStatusSummaryCard.tsx
@@ -4,7 +4,6 @@ import { getWorkspacesUpgradeHealthText } from '@/settings/admin-panel/utils/get
import { SettingsTableCard } from '@/settings/components/SettingsTableCard';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { UserContext } from '@/users/contexts/UserContext';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { Status } from 'twenty-ui/primitives/data-display';
import {
@@ -15,6 +14,7 @@ import {
} from 'twenty-ui/icon';
import { dateLocaleState } from '@/localization/states/dateLocaleState';
import { formatDateTimeString } from '@/object-record/record-field/ui/utils/formatDateTimeString';
+import { useLingui } from '@lingui/react/macro';
type SettingsAdminWorkspacesStatusSummaryCardProps = {
behindCount: number;
@@ -27,6 +27,7 @@ export const SettingsAdminWorkspacesStatusSummaryCard = ({
failedCount,
computedAt,
}: SettingsAdminWorkspacesStatusSummaryCardProps) => {
+ const { t } = useLingui();
const { dateFormat, timeFormat, timeZone } = useContext(UserContext);
const { localeCatalog } = useAtomStateValue(dateLocaleState);
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useDeleteJobs.ts b/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useDeleteJobs.ts
index a943f303d97..9dcc79d12e7 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useDeleteJobs.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useDeleteJobs.ts
@@ -1,12 +1,13 @@
import { useApolloAdminClient } from '@/settings/admin-panel/apollo/hooks/useApolloAdminClient';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
import { DeleteJobsDocument } from '~/generated-admin/graphql';
import { getErrorMessageFromApolloError } from '~/utils/get-error-message-from-apollo-error.util';
+import { useLingui } from '@lingui/react/macro';
export const useDeleteJobs = ({
queueName,
@@ -15,6 +16,7 @@ export const useDeleteJobs = ({
queueName: string;
onSuccess?: () => void;
}) => {
+ const { t } = useLingui();
const apolloAdminClient = useApolloAdminClient();
const { enqueueToast } = useToast();
const [isDeleting, setIsDeleting] = useState(false);
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useRetryJobs.ts b/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useRetryJobs.ts
index fdaffd4e2fc..cbb9276a3fe 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useRetryJobs.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useRetryJobs.ts
@@ -1,12 +1,13 @@
import { useApolloAdminClient } from '@/settings/admin-panel/apollo/hooks/useApolloAdminClient';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
import { RetryJobsDocument } from '~/generated-admin/graphql';
import { getErrorMessageFromApolloError } from '~/utils/get-error-message-from-apollo-error.util';
+import { useLingui } from '@lingui/react/macro';
export const useRetryJobs = ({
queueName,
@@ -15,6 +16,7 @@ export const useRetryJobs = ({
queueName: string;
onSuccess?: () => void;
}) => {
+ const { t } = useLingui();
const apolloAdminClient = useApolloAdminClient();
const { enqueueToast } = useToast();
const [isRetrying, setIsRetrying] = useState(false);
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx
index f3e089218a5..cc946383aa0 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx
@@ -13,7 +13,6 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { useMutation } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useCallback } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -23,6 +22,7 @@ import { IconLink, IconTool } from 'twenty-ui/icon';
import { Status } from 'twenty-ui/primitives/data-display';
import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledFormContainer = styled.div`
display: flex;
@@ -36,6 +36,7 @@ const StyledStatusRow = styled.div`
`;
export const SettingsAdminMaintenanceMode = () => {
+ const { t } = useLingui();
const apolloAdminClient = useApolloAdminClient();
const [adminPanelMaintenanceMode, setAdminPanelMaintenanceMode] =
useAtomState(adminPanelMaintenanceModeState);
@@ -105,7 +106,7 @@ export const SettingsAdminMaintenanceMode = () => {
});
}
},
- [setMaintenanceModeMutation, setMaintenanceMode, enqueueToast],
+ [setMaintenanceModeMutation, setMaintenanceMode, enqueueToast, t],
);
const handleToggle = useCallback(
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useHandleImpersonate.ts b/packages/twenty-front/src/modules/settings/admin-panel/hooks/useHandleImpersonate.ts
index ca0e93789d5..e4a115675ee 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useHandleImpersonate.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/hooks/useHandleImpersonate.ts
@@ -1,7 +1,6 @@
import { useState } from 'react';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { AppPath } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -13,8 +12,10 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { useToast } from 'twenty-ui/components/feedback';
import { ImpersonateDocument } from '~/generated-metadata/graphql';
import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';
+import { useLingui } from '@lingui/react/macro';
export const useHandleImpersonate = () => {
+ const { t } = useLingui();
const currentUser = useAtomStateValue(currentUserState);
const currentWorkspace = useAtomStateValue(currentWorkspaceState);
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useSettingsAdminTabs.ts b/packages/twenty-front/src/modules/settings/admin-panel/hooks/useSettingsAdminTabs.ts
index 7ab88b042cc..4e7d5886298 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useSettingsAdminTabs.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/hooks/useSettingsAdminTabs.ts
@@ -2,7 +2,6 @@ import { currentUserState } from '@/auth/states/currentUserState';
import { billingState } from '@/client-config/states/billingState';
import { SETTINGS_ADMIN_TABS } from '@/settings/admin-panel/constants/SettingsAdminTabs';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import {
IconApps,
IconHeart,
@@ -11,8 +10,10 @@ import {
IconSparkles,
IconVariable,
} from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const useSettingsAdminTabs = () => {
+ const { t } = useLingui();
const currentUser = useAtomStateValue(currentUserState);
const billing = useAtomStateValue(billingState);
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/signing-keys/components/SettingsAdminRevokeSigningKeyConfirmationModal.tsx b/packages/twenty-front/src/modules/settings/admin-panel/signing-keys/components/SettingsAdminRevokeSigningKeyConfirmationModal.tsx
index 85187093902..c67bd04be55 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/signing-keys/components/SettingsAdminRevokeSigningKeyConfirmationModal.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/signing-keys/components/SettingsAdminRevokeSigningKeyConfirmationModal.tsx
@@ -1,5 +1,5 @@
import { ConfirmationDialog } from '@/ui/layout/dialog/components/ConfirmationDialog';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type SettingsAdminRevokeSigningKeyConfirmationModalProps = {
modalInstanceId: string;
@@ -14,6 +14,7 @@ export const SettingsAdminRevokeSigningKeyConfirmationModal = ({
onConfirm,
onClose,
}: SettingsAdminRevokeSigningKeyConfirmationModalProps) => {
+ const { t } = useLingui();
const subtitle = isCurrent
? t`This is the current signing key. Revoking it will invalidate every JWT signed with it and users may need to sign in again. A new signing key will be generated automatically on the next request.`
: t`Revoking this key will invalidate every JWT signed with it. Users with active tokens signed by this key will be logged out.`;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/signing-keys/hooks/useRevokeSigningKey.ts b/packages/twenty-front/src/modules/settings/admin-panel/signing-keys/hooks/useRevokeSigningKey.ts
index cbb0880ce8e..2c4fda96dbf 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/signing-keys/hooks/useRevokeSigningKey.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/signing-keys/hooks/useRevokeSigningKey.ts
@@ -2,13 +2,14 @@ import { useApolloAdminClient } from '@/settings/admin-panel/apollo/hooks/useApo
import { GET_SIGNING_KEYS } from '@/settings/admin-panel/signing-keys/graphql/queries/getSigningKeys';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { useToast } from 'twenty-ui/components/feedback';
import { RevokeSigningKeyDocument } from '~/generated-admin/graphql';
import { getErrorMessageFromApolloError } from '~/utils/get-error-message-from-apollo-error.util';
+import { useLingui } from '@lingui/react/macro';
export const useRevokeSigningKey = (onSuccess?: () => void) => {
+ const { t } = useLingui();
const apolloAdminClient = useApolloAdminClient();
const { enqueueToast } = useToast();
const [isRevoking, setIsRevoking] = useState(false);
diff --git a/packages/twenty-front/src/modules/settings/ai/components/SettingsAiModelsTable.tsx b/packages/twenty-front/src/modules/settings/ai/components/SettingsAiModelsTable.tsx
index 58689390383..2ace6f233bb 100644
--- a/packages/twenty-front/src/modules/settings/ai/components/SettingsAiModelsTable.tsx
+++ b/packages/twenty-front/src/modules/settings/ai/components/SettingsAiModelsTable.tsx
@@ -1,9 +1,8 @@
-import { t } from '@lingui/core/macro';
import { useRef, useState } from 'react';
import { css } from '@linaria/core';
import { styled } from '@linaria/react';
-import { Trans } from '@lingui/react/macro';
+import { Trans, useLingui } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconTrash } from 'twenty-ui/icon';
import { Tooltip } from 'twenty-ui/primitives/surfaces';
@@ -86,6 +85,7 @@ export const SettingsAiModelsTable = <TModel extends AiModelSummary>({
showProviderColumn = true,
anchorPrefix,
}: SettingsAiModelsTableProps<TModel>) => {
+ const { t } = useLingui();
const hoveredRowRef = useRef<HTMLDivElement>(null);
const [hoveredModelId, setHoveredModelId] = useState<string | null>(null);
const theme = useTheme();
diff --git a/packages/twenty-front/src/modules/settings/ai/components/SettingsToolParameterTable.tsx b/packages/twenty-front/src/modules/settings/ai/components/SettingsToolParameterTable.tsx
index b4d24c4a0f1..e073b709f3a 100644
--- a/packages/twenty-front/src/modules/settings/ai/components/SettingsToolParameterTable.tsx
+++ b/packages/twenty-front/src/modules/settings/ai/components/SettingsToolParameterTable.tsx
@@ -2,7 +2,6 @@ import { NavigationButton } from '@/ui/input/components/NavigationButton';
import { SettingsEmptyPlaceholder } from '@/settings/components/SettingsEmptyPlaceholder';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type ComponentType } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -25,6 +24,7 @@ import {
} from 'twenty-ui/icon';
import { Tooltip } from 'twenty-ui/primitives/surfaces';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SchemaProperty = {
type?: string;
@@ -95,6 +95,7 @@ export const SettingsToolParameterTable = ({
requiredFields,
functionLink,
}: SettingsToolParameterTableProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const entries = Object.entries(schemaProperties);
diff --git a/packages/twenty-front/src/modules/settings/ai/hooks/useSettingsAiBehavior.ts b/packages/twenty-front/src/modules/settings/ai/hooks/useSettingsAiBehavior.ts
index af9329ba04b..95ff09ece39 100644
--- a/packages/twenty-front/src/modules/settings/ai/hooks/useSettingsAiBehavior.ts
+++ b/packages/twenty-front/src/modules/settings/ai/hooks/useSettingsAiBehavior.ts
@@ -4,7 +4,6 @@ import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import {
@@ -14,12 +13,14 @@ import {
UpdateWorkspaceDocument,
} from '~/generated-metadata/graphql';
import { getErrorMessageFromApolloError } from '~/utils/get-error-message-from-apollo-error.util';
+import { useLingui } from '@lingui/react/macro';
type AssistantModeField =
| 'aiChatDirectMessageAssistantMode'
| 'aiChatInboxAssistantMode';
export const useSettingsAiBehavior = () => {
+ const { t } = useLingui();
const [currentWorkspace, setCurrentWorkspace] = useAtomState(
currentWorkspaceState,
);
diff --git a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesMessageChannelDetails.tsx b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesMessageChannelDetails.tsx
index 1ca52e06587..1ffe1052f35 100644
--- a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesMessageChannelDetails.tsx
+++ b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesMessageChannelDetails.tsx
@@ -1,7 +1,5 @@
import { useMutation } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
import {
type MessageChannelContactAutoCreationPolicy,
MessageChannelType,
@@ -19,6 +17,7 @@ import { SettingsAccountsMessageVisibilityCard } from '@/settings/accounts/compo
import { UPDATE_MESSAGE_CHANNEL } from '@/settings/accounts/graphql/mutations/updateMessageChannel';
import { SettingsOptionCardContentSwitch } from '@/settings/components/SettingsOptions/SettingsOptionCardContentSwitch';
import { type MessageChannelVisibility } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type SettingsAppPreferencesMessageChannelDetailsProps = {
messageChannel: Pick<
@@ -51,6 +50,7 @@ const StyledDetailsContainer = styled.div`
export const SettingsAppPreferencesMessageChannelDetails = ({
messageChannel,
}: SettingsAppPreferencesMessageChannelDetailsProps) => {
+ const { t } = useLingui();
const [updateMessageChannel] = useMutation(UPDATE_MESSAGE_CHANNEL);
const updateChannel = (update: MessageChannelUpdateInput) => {
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationAboutSidebar.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationAboutSidebar.tsx
index 4104e49e472..667b4f4cf9b 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationAboutSidebar.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationAboutSidebar.tsx
@@ -2,7 +2,7 @@ import { AppChip } from '@/applications/components/AppChip';
import { useNumberFormat } from '@/localization/hooks/useNumberFormat';
import { getInstallCountEstimate } from '@/settings/applications/utils/getInstallCountEstimate';
import { styled } from '@linaria/react';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { emailSchema, isDefined, isSafeUrl } from 'twenty-shared/utils';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
@@ -22,6 +22,7 @@ import {
} from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
export type DeveloperLinks = {
websiteUrl?: string;
@@ -164,6 +165,7 @@ export const SettingsApplicationAboutSidebar = ({
billsCredits = false,
developerLinks,
}: SettingsApplicationAboutSidebarProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const { formatNumber } = useNumberFormat();
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationActionButton.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationActionButton.tsx
index b2c3e684906..1831be8c14b 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationActionButton.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationActionButton.tsx
@@ -1,10 +1,10 @@
import { formatQueueJobProgressLabel } from '@/queue-job/utils/formatQueueJobProgressLabel';
-import { t } from '@lingui/core/macro';
import { Link } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
import { IconDownload, IconSettings } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
type SettingsApplicationActionButtonProps = {
installedApplicationId?: string;
@@ -21,6 +21,7 @@ export const SettingsApplicationActionButton = ({
isInstalling,
installProgress,
}: SettingsApplicationActionButtonProps) => {
+ const { t } = useLingui();
if (isDefined(installedApplicationId) && !isInstalling) {
return (
<Button
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationDetailVariablesTab.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationDetailVariablesTab.tsx
index e27702b5fdc..58a975b3194 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationDetailVariablesTab.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationDetailVariablesTab.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { type ApplicationVariableOption } from 'twenty-shared/application';
import { LightButton } from 'twenty-ui/components/input';
@@ -8,6 +7,7 @@ import { themeCssVariables } from 'twenty-ui/theme';
import { type ApplicationVariable } from '~/generated-metadata/graphql';
import { SettingsApplicationVariableInput } from '@/settings/applications/components/SettingsApplicationVariableInput';
import { SettingsApplicationVariableLabelRow } from '@/settings/applications/components/SettingsApplicationVariableLabelRow';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: flex;
@@ -41,6 +41,7 @@ export const SettingsApplicationDetailVariablesTab = ({
onVariableChange,
onVariableClear,
}: SettingsApplicationDetailVariablesTabProps) => {
+ const { t } = useLingui();
const sectionDescription =
applicationVariables.length > 0
? t`Set your application configuration variables`
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationIframeMediaPermissionsSection.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationIframeMediaPermissionsSection.tsx
index 54bf01d3ece..e3c18a452c3 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationIframeMediaPermissionsSection.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationIframeMediaPermissionsSection.tsx
@@ -3,7 +3,6 @@ import { buildApplicationIframeMediaPermissionSummary } from '@/marketplace/util
import { getPendingApplicationIframeMediaPermissions } from '@/settings/applications/utils/getPendingApplicationIframeMediaPermissions';
import { useApolloClient, useMutation } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { type IframeMediaPermission } from 'twenty-shared/types';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
@@ -16,6 +15,7 @@ import {
ApproveApplicationIframeMediaPermissionsDocument,
FindOneApplicationDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type SettingsApplicationIframeMediaPermissionsSectionProps = {
applicationId: string;
@@ -36,6 +36,7 @@ export const SettingsApplicationIframeMediaPermissionsSection = ({
requestedPermissions,
grantedPermissions,
}: SettingsApplicationIframeMediaPermissionsSectionProps) => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const apolloClient = useApolloClient();
const [hasSavedChanges, setHasSavedChanges] = useState(false);
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationLoadErrorBanner.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationLoadErrorBanner.tsx
index 16dd53bec45..3802f7ca5b8 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationLoadErrorBanner.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationLoadErrorBanner.tsx
@@ -1,6 +1,6 @@
-import { t } from '@lingui/core/macro';
import { InlineBanner } from 'twenty-ui/components/feedback';
import { IconAlertTriangle } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type SettingsApplicationLoadErrorBannerProps = {
message?: string;
@@ -11,6 +11,7 @@ export const SettingsApplicationLoadErrorBanner = ({
message,
onRetry,
}: SettingsApplicationLoadErrorBannerProps) => {
+ const { t } = useLingui();
return (
<InlineBanner
status="error"
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationMissingConfigurationBanner.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationMissingConfigurationBanner.tsx
index cca6c9ca93a..9d346805313 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationMissingConfigurationBanner.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationMissingConfigurationBanner.tsx
@@ -1,8 +1,8 @@
-import { t } from '@lingui/core/macro';
import { InlineBanner } from 'twenty-ui/components/feedback';
import { IconAlertCircle } from 'twenty-ui/icon';
import { type ApplicationVariable } from '~/generated-metadata/graphql';
import { getApplicationVariableDisplayLabel } from '@/settings/applications/utils/getApplicationVariableDisplayLabel';
+import { useLingui } from '@lingui/react/macro';
type SettingsApplicationMissingConfigurationBannerProps = {
missingApplicationVariables: Pick<ApplicationVariable, 'key' | 'label'>[];
@@ -13,6 +13,7 @@ export const SettingsApplicationMissingConfigurationBanner = ({
missingApplicationVariables,
onConfigure,
}: SettingsApplicationMissingConfigurationBannerProps) => {
+ const { t } = useLingui();
const missingLabels = missingApplicationVariables
.map(getApplicationVariableDisplayLabel)
.join(', ');
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationScreenshotGallery.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationScreenshotGallery.tsx
index 97ba02b8ba7..fc96d47bf61 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationScreenshotGallery.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationScreenshotGallery.tsx
@@ -1,10 +1,10 @@
import { SettingsApplicationScreenshotLightbox } from '@/settings/applications/components/SettingsApplicationScreenshotLightbox';
import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useId, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SettingsApplicationScreenshotGalleryProps = {
screenshots: string[];
@@ -86,6 +86,7 @@ export const SettingsApplicationScreenshotGallery = ({
screenshots: allScreenshots,
displayName,
}: SettingsApplicationScreenshotGalleryProps) => {
+ const { t } = useLingui();
const [selectedScreenshot, setSelectedScreenshot] = useState<
string | undefined
>(undefined);
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationScreenshotLightbox.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationScreenshotLightbox.tsx
index 381b439a014..5a7368e3a92 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationScreenshotLightbox.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationScreenshotLightbox.tsx
@@ -1,12 +1,12 @@
import { DialogInstance } from '@/ui/layout/dialog/components/DialogInstance';
import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Key } from 'ts-key-enum';
import { IconButton } from 'twenty-ui/components/input';
import { IconChevronLeft, IconChevronRight, IconX } from 'twenty-ui/icon';
import { Dialog } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SettingsApplicationScreenshotLightboxProps = {
modalInstanceId: string;
@@ -73,6 +73,7 @@ export const SettingsApplicationScreenshotLightbox = ({
onSelectedIndexChange,
onClose,
}: SettingsApplicationScreenshotLightboxProps) => {
+ const { t } = useLingui();
const screenshotCount = screenshots.length;
const hasSeveralScreenshots = screenshotCount > 1;
const screenshotNumber = selectedIndex + 1;
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationUninstallButton.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationUninstallButton.tsx
index 50af3c67026..10d36caf713 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationUninstallButton.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationUninstallButton.tsx
@@ -2,8 +2,7 @@ import { formatQueueJobProgressLabel } from '@/queue-job/utils/formatQueueJobPro
import { ConfirmationDialog } from '@/ui/layout/dialog/components/ConfirmationDialog';
import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
import { TooltipDelay } from '@/ui/layout/tooltip/constants/TooltipDelay';
-import { t } from '@lingui/core/macro';
-import { Trans } from '@lingui/react/macro';
+import { Trans, useLingui } from '@lingui/react/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useId } from 'react';
import { IconTrash } from 'twenty-ui/icon';
@@ -25,6 +24,7 @@ export const SettingsApplicationUninstallButton = ({
uninstallProgress,
disabledReason,
}: SettingsApplicationUninstallButtonProps) => {
+ const { t } = useLingui();
const { openDialog } = useDialog();
const uninstallDialogId = useId();
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationVariableInput.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationVariableInput.tsx
index 54a4d7af54d..5738b7fcc3c 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationVariableInput.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationVariableInput.tsx
@@ -9,7 +9,6 @@ import { FormRichTextFieldInput } from '@/object-record/record-field/ui/form-typ
import { FormSelectFieldInput } from '@/object-record/record-field/ui/form-types/components/FormSelectFieldInput';
import { type FieldRichTextValue } from '@/object-record/record-field/ui/types/FieldMetadata';
import { TextInput } from '@/ui/input/components/TextInput';
-import { t } from '@lingui/core/macro';
import {
type ApplicationVariableOption,
deserializeApplicationVariableValue,
@@ -17,6 +16,7 @@ import {
import { FieldMetadataType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { type SelectOption } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
type SettingsApplicationVariableInputProps = {
type?: string | null;
@@ -74,6 +74,7 @@ export const SettingsApplicationVariableInput = ({
disabled,
isSecret,
}: SettingsApplicationVariableInputProps) => {
+ const { t } = useLingui();
const fieldType = (type as FieldMetadataType) ?? FieldMetadataType.TEXT;
switch (fieldType) {
diff --git a/packages/twenty-front/src/modules/settings/applications/hooks/useApplicationVariablesDraft.ts b/packages/twenty-front/src/modules/settings/applications/hooks/useApplicationVariablesDraft.ts
index d45fd3d584f..17884b6547a 100644
--- a/packages/twenty-front/src/modules/settings/applications/hooks/useApplicationVariablesDraft.ts
+++ b/packages/twenty-front/src/modules/settings/applications/hooks/useApplicationVariablesDraft.ts
@@ -1,6 +1,5 @@
import { useAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyState';
import { isNonEmptyString } from '@sniptt/guards';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { useToast } from 'twenty-ui/components/feedback';
import {
@@ -8,6 +7,7 @@ import {
type ApplicationVariableScope,
} from '~/generated-metadata/graphql';
import { applicationVariablesDraftFamilyState } from '@/settings/applications/states/applicationVariablesDraftFamilyState';
+import { useLingui } from '@lingui/react/macro';
export const useApplicationVariablesDraft = <
DraftableApplicationVariable extends Pick<
@@ -29,6 +29,7 @@ export const useApplicationVariablesDraft = <
) => Promise<unknown>;
refetchApplicationVariables: () => Promise<unknown>;
}) => {
+ const { t } = useLingui();
const [draftValueByKey, setDraftValueByKey] = useAtomFamilyState(
applicationVariablesDraftFamilyState,
{ applicationId, scope },
diff --git a/packages/twenty-front/src/modules/settings/applications/hooks/useUninstallApplication.ts b/packages/twenty-front/src/modules/settings/applications/hooks/useUninstallApplication.ts
index 951a4e02a3e..51da1ef7b6f 100644
--- a/packages/twenty-front/src/modules/settings/applications/hooks/useUninstallApplication.ts
+++ b/packages/twenty-front/src/modules/settings/applications/hooks/useUninstallApplication.ts
@@ -4,7 +4,6 @@ import { type TrackedJobStatus } from '@/queue-job/types/TrackedJobStatus';
import { isTerminalJobState } from '@/queue-job/utils/isTerminalJobState';
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { useLazyQuery, useMutation, useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useCallback } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -14,6 +13,7 @@ import {
JobState,
TriggerUninstallApplicationDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type UseUninstallApplicationArgs = {
universalIdentifier?: string;
@@ -24,6 +24,7 @@ export const useUninstallApplication = ({
universalIdentifier,
onCompleted,
}: UseUninstallApplicationArgs = {}) => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const [triggerUninstallApplication, { loading: isTriggeringUninstall }] =
useMutation(TriggerUninstallApplicationDocument);
@@ -86,7 +87,7 @@ export const useUninstallApplication = ({
});
onCompleted?.();
},
- [enqueueToast, onCompleted, setCurrentWorkspace],
+ [enqueueToast, onCompleted, setCurrentWorkspace, t],
);
const fetchUninstallJobStatus = useCallback(
diff --git a/packages/twenty-front/src/modules/settings/billing/components/AddPaymentMethodForm.tsx b/packages/twenty-front/src/modules/settings/billing/components/AddPaymentMethodForm.tsx
index 225a2c32159..decca2d49f3 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/AddPaymentMethodForm.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/AddPaymentMethodForm.tsx
@@ -7,7 +7,6 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import {
Elements,
PaymentElement,
@@ -21,6 +20,7 @@ import { InlineBanner, useToast } from 'twenty-ui/components/feedback';
import { Button } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
import { CreateBillingPaymentMethodSetupIntentDocument } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type AddPaymentMethodFormContentProps = {
finalRedirectPath?: string;
@@ -42,6 +42,7 @@ const AddPaymentMethodFormContent = ({
onPaymentMethodAdded,
shouldStartSubscriptionAfterPaymentMethod = true,
}: AddPaymentMethodFormContentProps) => {
+ const { t } = useLingui();
const stripe = useStripe();
const elements = useElements();
const { enqueueToast } = useToast();
@@ -164,6 +165,7 @@ export const AddPaymentMethodForm = ({
onPaymentMethodAdded,
shouldStartSubscriptionAfterPaymentMethod,
}: AddPaymentMethodFormProps) => {
+ const { t } = useLingui();
const stripePromise = useStripePromise();
const appearance = useStripeAppearance();
diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingCreditsSection.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingCreditsSection.tsx
index 1baef33dca8..72442173aaf 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingCreditsSection.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingCreditsSection.tsx
@@ -19,7 +19,6 @@ import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
import { isSubscriptionPaymentOverdue } from '@/settings/billing/utils/isSubscriptionPaymentOverdue';
import { useSubscriptionStatus } from '@/workspace/hooks/useSubscriptionStatus';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { DOCUMENTATION_PATHS } from 'twenty-shared/constants';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
@@ -38,6 +37,7 @@ import {
SubscriptionStatus,
} from '~/generated-metadata/graphql';
import { openUrlInNewTab } from '~/utils/openUrlInNewTab';
+import { useLingui } from '@lingui/react/macro';
const StyledSettingsBillingCardBody = styled.div`
display: flex;
@@ -136,6 +136,7 @@ export const SettingsBillingCreditsSection = ({
onUpdatePayment: () => void;
isUpdatePaymentDisabled: boolean;
}) => {
+ const { t } = useLingui();
const theme = useTheme();
const subscriptionStatus = useSubscriptionStatus();
const { openDialog } = useDialog();
diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingTrialNoPaymentMethodBanner.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingTrialNoPaymentMethodBanner.tsx
index 9141e7a7a5d..2995b3c8c73 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingTrialNoPaymentMethodBanner.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingTrialNoPaymentMethodBanner.tsx
@@ -5,7 +5,6 @@ import { BILLING_PLAN_LABELS } from '@/settings/billing/constants/BillingPlanLab
import { getSubscriptionPlanKey } from '@/settings/billing/utils/getSubscriptionPlanKey';
import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
import { InlineBanner } from 'twenty-ui/components/feedback';
@@ -14,6 +13,7 @@ import {
PermissionFlagType,
} from '~/generated-metadata/graphql';
import { formatDate } from '~/utils/date-utils';
+import { useLingui } from '@lingui/react/macro';
type SettingsBillingTrialNoPaymentMethodBannerProps = {
currentBillingSubscription: NonNullable<
@@ -24,6 +24,7 @@ type SettingsBillingTrialNoPaymentMethodBannerProps = {
export const SettingsBillingTrialNoPaymentMethodBanner = ({
currentBillingSubscription,
}: SettingsBillingTrialNoPaymentMethodBannerProps) => {
+ const { t } = useLingui();
const { redirect } = useRedirect();
const hasPermissionToManageBilling = useHasPermissionFlag(
diff --git a/packages/twenty-front/src/modules/settings/billing/components/StartSubscriptionConfirmationModal.tsx b/packages/twenty-front/src/modules/settings/billing/components/StartSubscriptionConfirmationModal.tsx
index 9a025f5e4f5..3c0db4730ab 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/StartSubscriptionConfirmationModal.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/StartSubscriptionConfirmationModal.tsx
@@ -1,5 +1,5 @@
import { ConfirmationDialog } from '@/ui/layout/dialog/components/ConfirmationDialog';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type StartSubscriptionConfirmationModalProps = {
modalInstanceId: string;
@@ -14,6 +14,7 @@ export const StartSubscriptionConfirmationModal = ({
onConfirmClick,
loading,
}: StartSubscriptionConfirmationModalProps) => {
+ const { t } = useLingui();
const needsCreditCard = hasPaymentMethod === false;
return (
diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/PlansTags.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/PlansTags.tsx
index 985281b41b2..1c8913df66f 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/internal/PlansTags.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/PlansTags.tsx
@@ -1,11 +1,11 @@
import React from 'react';
import { Tag } from 'twenty-ui/primitives/data-display';
-import { t } from '@lingui/core/macro';
import { BILLING_PLAN_LABELS } from '@/settings/billing/constants/BillingPlanLabels';
import { BILLING_PLAN_TAG_COLORS } from '@/settings/billing/constants/BillingPlanTagColors';
import { type BillingPlanKey } from '~/generated-metadata/graphql';
import { styled } from '@linaria/react';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type PlansTagsProps = {
plan: BillingPlanKey;
@@ -18,6 +18,7 @@ const StyledTagsWrapper = styled.div`
`;
export const PlansTags = ({ plan, isTrialPeriod = false }: PlansTagsProps) => {
+ const { t } = useLingui();
return (
<StyledTagsWrapper>
<Tag color={BILLING_PLAN_TAG_COLORS[plan]}>
diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsx
index 21c3fc9afc6..9b0375e9478 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsx
@@ -2,7 +2,6 @@ import { AnimatedFormattedNumber } from '@/settings/billing/components/internal/
import { BILLING_MODAL_IDS } from '@/settings/billing/constants/BillingModalIds';
import { DialogInstance } from '@/ui/layout/dialog/components/DialogInstance';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { AnimatePresence, motion } from 'framer-motion';
import { type ElementType, type ReactNode } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -16,6 +15,7 @@ import {
import { Button, Slider } from 'twenty-ui/primitives/input';
import { Dialog } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables, useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const PACKAGE_SUMMARY_ROW_HEIGHT = 24;
const PACKAGE_SUMMARY_ROW_GAP = 4;
@@ -202,6 +202,7 @@ export const ResourceCreditPackagePickerModal = ({
selectedPriceAmountValue,
selectedPriceIndex,
}: ResourceCreditPackagePickerModalProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const renderPackageSummaryRow = ({
diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPriceSelector.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPriceSelector.tsx
index 78e18196b23..76c93af8566 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPriceSelector.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPriceSelector.tsx
@@ -10,7 +10,6 @@ import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useMemo, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
@@ -27,6 +26,7 @@ import {
SubscriptionInterval,
type BillingPriceLicensed,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const PREDEFINED_RESOURCE_CREDIT_PACKAGE_MULTIPLIERS = [2, 4];
@@ -63,6 +63,7 @@ export const ResourceCreditPriceSelector = ({
canCancelCreditPackSwitch?: boolean;
onCancelCreditPackSwitch?: () => void;
}) => {
+ const { t } = useLingui();
const {
currentResourceCreditBillingPrice,
currentResourceCreditSubscriptionItem,
diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/SubscriptionInfoRowContainer.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/SubscriptionInfoRowContainer.tsx
index f3261f98cdb..6589160c57f 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/internal/SubscriptionInfoRowContainer.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/SubscriptionInfoRowContainer.tsx
@@ -1,8 +1,8 @@
import { type IconComponent } from 'twenty-ui/icon';
import React from 'react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SubscriptionInfoRowContainerProps = {
Icon: IconComponent;
@@ -38,6 +38,7 @@ const StyledHeaderText = styled.div`
`;
export const SubscriptionInfoHeaderRow = ({ show }: { show: boolean }) => {
+ const { t } = useLingui();
if (!show) return null;
return (
<StyledContainer>
diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useCreditUpgradeAction.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useCreditUpgradeAction.ts
index 15f2a9448a6..252fd7b1f2b 100644
--- a/packages/twenty-front/src/modules/settings/billing/hooks/useCreditUpgradeAction.ts
+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useCreditUpgradeAction.ts
@@ -3,15 +3,16 @@ import { useApplyCurrentWorkspaceBillingUpdate } from '@/settings/billing/hooks/
import { useGetNextResourceCreditPrice } from '@/settings/billing/hooks/useGetNextResourceCreditPrice';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
import {
SetResourceCreditSubscriptionPriceDocument,
SubscriptionInterval,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useCreditUpgradeAction = () => {
+ const { t } = useLingui();
const nextPrice = useGetNextResourceCreditPrice();
const { formatNumber } = useNumberFormat();
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useEndSubscriptionTrialPeriod.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useEndSubscriptionTrialPeriod.ts
index ca8432bc341..ed0c5691271 100644
--- a/packages/twenty-front/src/modules/settings/billing/hooks/useEndSubscriptionTrialPeriod.ts
+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useEndSubscriptionTrialPeriod.ts
@@ -4,7 +4,6 @@ import { START_SUBSCRIPTION_AFTER_PAYMENT_METHOD_QUERY_PARAM } from '@/settings/
import { useApplyCurrentWorkspaceBillingUpdate } from '@/settings/billing/hooks/useApplyCurrentWorkspaceBillingUpdate';
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { useLazyQuery, useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { useLocation } from 'react-router-dom';
import { isDefined } from 'twenty-shared/utils';
@@ -14,8 +13,10 @@ import {
EndSubscriptionTrialPeriodDocument,
GetResourceCreditUsageDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useEndSubscriptionTrialPeriod = () => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const [endSubscriptionTrialPeriod] = useMutation(
EndSubscriptionTrialPeriodDocument,
diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useHandleCheckoutSession.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useHandleCheckoutSession.ts
index 261a1cf1733..5d17c205ff5 100644
--- a/packages/twenty-front/src/modules/settings/billing/hooks/useHandleCheckoutSession.ts
+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useHandleCheckoutSession.ts
@@ -2,7 +2,6 @@ import { useRedirect } from '@/domain-manager/hooks/useRedirect';
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
@@ -11,6 +10,7 @@ import {
type SubscriptionInterval,
CheckoutSessionDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useHandleCheckoutSession = ({
recurringInterval,
@@ -23,6 +23,7 @@ export const useHandleCheckoutSession = ({
requirePaymentMethod: boolean;
successUrlPath: string;
}) => {
+ const { t } = useLingui();
const { redirect } = useRedirect();
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useSubmitSubscriptionPayment.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useSubmitSubscriptionPayment.ts
index 2dc96296b3e..86811989362 100644
--- a/packages/twenty-front/src/modules/settings/billing/hooks/useSubmitSubscriptionPayment.ts
+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useSubmitSubscriptionPayment.ts
@@ -1,7 +1,6 @@
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useElements, useStripe } from '@stripe/react-stripe-js';
import { useState } from 'react';
import { AppPath } from 'twenty-shared/types';
@@ -12,6 +11,7 @@ import {
type SubscriptionInterval,
CreateSubscriptionPaymentIntentDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type UseSubmitSubscriptionPaymentParams = {
plan: BillingPlanKey;
@@ -22,6 +22,7 @@ export const useSubmitSubscriptionPayment = ({
plan,
recurringInterval,
}: UseSubmitSubscriptionPaymentParams) => {
+ const { t } = useLingui();
const stripe = useStripe();
const elements = useElements();
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useWaitForPaymentRecovery.tsx b/packages/twenty-front/src/modules/settings/billing/hooks/useWaitForPaymentRecovery.tsx
index cca1ce4eecf..2af3e3f5f6c 100644
--- a/packages/twenty-front/src/modules/settings/billing/hooks/useWaitForPaymentRecovery.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useWaitForPaymentRecovery.tsx
@@ -6,15 +6,16 @@ import { waitForSubscriptionRecovery } from '@/settings/billing/utils/waitForSub
import { NavigationButton } from '@/ui/input/components/NavigationButton';
import { useLoadCurrentUser } from '@/users/hooks/useLoadCurrentUser';
import { useApolloClient } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
import { GetCurrentUserDocument } from '~/generated-metadata/graphql';
import { logError } from '~/utils/logError';
import { sleep } from '~/utils/sleep';
+import { useLingui } from '@lingui/react/macro';
export const useWaitForPaymentRecovery = () => {
+ const { t } = useLingui();
const client = useApolloClient();
const { loadCurrentUser } = useLoadCurrentUser();
const { applyCurrentWorkspaceBillingUpdate } =
diff --git a/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/SaveButton.tsx b/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/SaveButton.tsx
index 88198b93c56..4cba782f34e 100644
--- a/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/SaveButton.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/SaveButton.tsx
@@ -1,6 +1,6 @@
-import { t } from '@lingui/core/macro';
import { type IconComponent, IconDeviceFloppy } from 'twenty-ui/icon';
import { Button, type ButtonColor } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
type SaveButtonProps = {
onSave?: () => void;
@@ -17,6 +17,7 @@ export const SaveButton = ({
color = 'accent',
saveIcon: SaveIcon = IconDeviceFloppy,
}: SaveButtonProps) => {
+ const { t } = useLingui();
return (
<Button
size="sm"
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsCard.tsx b/packages/twenty-front/src/modules/settings/components/SettingsCard.tsx
index 6dd39388368..baeff820337 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsCard.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsCard.tsx
@@ -1,6 +1,4 @@
import { styled } from '@linaria/react';
-
-import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { Link } from 'react-router-dom';
import { isDefined } from 'twenty-shared/utils';
@@ -8,6 +6,7 @@ import { IconChevronRight } from 'twenty-ui/icon';
import { Badge } from 'twenty-ui/primitives/data-display';
import { Card } from 'twenty-ui/primitives/surfaces';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SettingsCardProps = {
description?: string;
@@ -100,6 +99,7 @@ export const SettingsCard = ({
className,
Status,
}: SettingsCardProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const getContentOwner = () => {
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsCounter.tsx b/packages/twenty-front/src/modules/settings/components/SettingsCounter.tsx
index 25211a1b93b..e55990c8820 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsCounter.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsCounter.tsx
@@ -3,7 +3,6 @@ import { useRemoveFocusItemFromFocusStackById } from '@/ui/utilities/focus/hooks
import { FocusComponentType } from '@/ui/utilities/focus/types/FocusComponentType';
import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isInteger, isNonEmptyString } from '@sniptt/guards';
import { useId, useRef } from 'react';
import { Key } from 'ts-key-enum';
@@ -13,6 +12,7 @@ import {
type NumberStepperProps,
} from 'twenty-ui/components/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const SETTINGS_COUNTER_CARET_NAVIGATION_KEYS: string[] = [Key.Home, Key.End];
@@ -49,6 +49,7 @@ export const SettingsCounter = ({
'aria-labelledby': ariaLabelledBy,
'aria-describedby': ariaDescribedBy,
}: SettingsCounterProps) => {
+ const { t } = useLingui();
const instanceId = useId();
const inputRef = useRef<HTMLInputElement>(null);
const { pushFocusItemToFocusStack } = usePushFocusItemToFocusStack();
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsCustomizeVideoModal.tsx b/packages/twenty-front/src/modules/settings/components/SettingsCustomizeVideoModal.tsx
index d47b8479469..e782238b423 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsCustomizeVideoModal.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsCustomizeVideoModal.tsx
@@ -3,7 +3,6 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { type SettingsCustomizeVideoModalTab } from '@/settings/types/SettingsCustomizeVideoModalTab';
import { TabListRoot } from '@/ui/layout/tab-list/components/TabListRoot';
import { Tabs } from 'twenty-ui/primitives/navigation';
-import { t } from '@lingui/core/macro';
import { DialogInstance } from '@/ui/layout/dialog/components/DialogInstance';
import { Dialog } from 'twenty-ui/primitives/surfaces';
import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
@@ -12,6 +11,7 @@ import { styled } from '@linaria/react';
import { IconX } from 'twenty-ui/icon';
import { IconButton } from 'twenty-ui/components/input';
import { themeCssVariables, useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SettingsCustomizeVideoModalProps = {
modalInstanceId: string;
@@ -78,6 +78,7 @@ export const SettingsCustomizeVideoModal = ({
tabsInstanceId,
tabs,
}: SettingsCustomizeVideoModalProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const { closeDialog } = useDialog();
const activeTabId = useAtomComponentStateValue(
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsDatabaseEventsForm.tsx b/packages/twenty-front/src/modules/settings/components/SettingsDatabaseEventsForm.tsx
index bafc6083094..3063e487545 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsDatabaseEventsForm.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsDatabaseEventsForm.tsx
@@ -2,12 +2,12 @@ import { WebhookEntitySelect } from '@/settings/developers/components/WebhookEnt
import { Select } from '@/ui/input/components/Select';
import { useIsMobile } from 'twenty-ui/utilities';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconBox, IconNorthStar, IconPlus, IconTrash } from 'twenty-ui/icon';
import { type SelectOption } from 'twenty-ui/primitives/input';
import { IconButton } from 'twenty-ui/components/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const OBJECT_DROPDOWN_WIDTH = 240;
const ACTION_DROPDOWN_WIDTH = 240;
@@ -49,6 +49,7 @@ export const SettingsDatabaseEventsForm = ({
removeOperation?: (index: number) => void;
disabled?: boolean;
}) => {
+ const { t } = useLingui();
const isMobile = useIsMobile();
const getActionOptions = (
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsDnsRecordsTable.tsx b/packages/twenty-front/src/modules/settings/components/SettingsDnsRecordsTable.tsx
index 4624dfcee43..5ef3978d079 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsDnsRecordsTable.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsDnsRecordsTable.tsx
@@ -4,12 +4,12 @@ import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { capitalize, isDefined } from 'twenty-shared/utils';
import { Status } from 'twenty-ui/primitives/data-display';
import { type ThemeColor, themeCssVariables } from 'twenty-ui/theme';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
+import { useLingui } from '@lingui/react/macro';
type DnsRecord = {
type: string;
@@ -52,6 +52,7 @@ const StyledCopyableCell = styled.div`
export const SettingsDnsRecordsTable = ({
records,
}: SettingsDnsRecordsTableProps) => {
+ const { t } = useLingui();
const { copyToClipboard } = useCopyToClipboard();
if (records.length === 0) {
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsItemTypeTag.tsx b/packages/twenty-front/src/modules/settings/components/SettingsItemTypeTag.tsx
index 3a325f14585..5df7cd3481c 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsItemTypeTag.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsItemTypeTag.tsx
@@ -1,8 +1,7 @@
-import { t } from '@lingui/core/macro';
-
import { AppChip } from '@/applications/components/AppChip';
import { Avatar, Chip } from 'twenty-ui/primitives/data-display';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
type SettingsItemTypeTagProps = {
item: {
@@ -14,6 +13,7 @@ type SettingsItemTypeTagProps = {
export const SettingsItemTypeTag = ({
item: { isRemote, applicationId },
}: SettingsItemTypeTagProps) => {
+ const { t } = useLingui();
if (isDefined(applicationId)) {
return <AppChip applicationId={applicationId} />;
}
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx b/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx
index 1dc32044440..b8383348cee 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx
@@ -1,6 +1,6 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { styled } from '@linaria/react';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { useRef, useState } from 'react';
import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems';
@@ -19,6 +19,7 @@ import { isDefined } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
import { IconBox } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SettingsMorphRelationMultiSelectProps = {
className?: string;
@@ -82,6 +83,7 @@ export const SettingsMorphRelationMultiSelect = ({
hasRightElement,
error,
}: SettingsMorphRelationMultiSelectProps) => {
+ const { t } = useLingui();
const dropdownContentRef = useRef<HTMLDivElement>(null);
const [searchInputValue, setSearchInputValue] = useState('');
diff --git a/packages/twenty-front/src/modules/settings/components/layout/SettingsWizardStepBar.tsx b/packages/twenty-front/src/modules/settings/components/layout/SettingsWizardStepBar.tsx
index 3ab4f93aa03..a5df7ce373e 100644
--- a/packages/twenty-front/src/modules/settings/components/layout/SettingsWizardStepBar.tsx
+++ b/packages/twenty-front/src/modules/settings/components/layout/SettingsWizardStepBar.tsx
@@ -1,9 +1,9 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconChevronLeft } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SettingsWizardStepBarProps = {
label: ReactNode;
@@ -46,21 +46,24 @@ export const SettingsWizardStepBar = ({
label,
onBack,
trailing,
-}: SettingsWizardStepBarProps) => (
- <StyledStepBar>
- <StyledLeft>
- {onBack && (
- <LightIconButton
- size="sm"
- emphasis="subtle"
- onClick={onBack}
- aria-label={t`Previous`}
- >
- <IconChevronLeft />
- </LightIconButton>
- )}
- </StyledLeft>
- <StyledLabel>{label}</StyledLabel>
- <StyledRight>{trailing}</StyledRight>
- </StyledStepBar>
-);
+}: SettingsWizardStepBarProps) => {
+ const { t } = useLingui();
+ return (
+ <StyledStepBar>
+ <StyledLeft>
+ {onBack && (
+ <LightIconButton
+ size="sm"
+ emphasis="subtle"
+ onClick={onBack}
+ aria-label={t`Previous`}
+ >
+ <IconChevronLeft />
+ </LightIconButton>
+ )}
+ </StyledLeft>
+ <StyledLabel>{label}</StyledLabel>
+ <StyledRight>{trailing}</StyledRight>
+ </StyledStepBar>
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/config-variables/components/ConfigVariableTable.tsx b/packages/twenty-front/src/modules/settings/config-variables/components/ConfigVariableTable.tsx
index ab9c6682410..bd7ecc7a857 100644
--- a/packages/twenty-front/src/modules/settings/config-variables/components/ConfigVariableTable.tsx
+++ b/packages/twenty-front/src/modules/settings/config-variables/components/ConfigVariableTable.tsx
@@ -4,10 +4,10 @@ import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { IconChevronRight } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledTableBodyContainer = styled.div`
border-bottom: 1px solid ${themeCssVariables.border.color.light};
@@ -27,6 +27,7 @@ type ConfigVariableTableProps = { configVariables: ConfigVariable[] };
export const ConfigVariableTable = ({
configVariables,
}: ConfigVariableTableProps) => {
+ const { t } = useLingui();
const theme = useTheme();
return (
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/address/components/MultiSelectAddressFields.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/address/components/MultiSelectAddressFields.tsx
index 2443022c062..d5f7bdc4128 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/address/components/MultiSelectAddressFields.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/address/components/MultiSelectAddressFields.tsx
@@ -4,7 +4,6 @@ import { type SelectValue } from '@/ui/input/components/internal/select/types';
import { type SelectSizeVariant } from '@/ui/input/types/SelectSizeVariant';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { type MouseEvent, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -12,6 +11,7 @@ import { Dropdown } from 'twenty-ui/components/navigation';
import { type IconComponent } from 'twenty-ui/icon';
import { Tag } from 'twenty-ui/primitives/data-display';
import { type SelectOption } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
type CallToActionButton = {
text: string;
@@ -40,6 +40,7 @@ export const MultiSelectAddressFields = <TValue extends SelectValue>({
values,
callToActionButton,
}: MultiSelectAddressFieldsProps<TValue>) => {
+ const { t } = useLingui();
const [searchInputValue, setSearchInputValue] = useState('');
const filteredOptions = isNonEmptyString(searchInputValue)
? options.filter(({ label }) =>
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldDescriptionForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldDescriptionForm.tsx
index 3c636a24007..7406536c9fa 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldDescriptionForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldDescriptionForm.tsx
@@ -5,7 +5,7 @@ import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataIte
import { fieldMetadataItemSchema } from '@/object-metadata/validation-schemas/fieldMetadataItemSchema';
import { TextArea } from '@/ui/input/components/TextArea';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
export const settingsDataModelFieldDescriptionFormSchema = () => {
return fieldMetadataItemSchema([]).pick({
@@ -26,6 +26,7 @@ export const SettingsDataModelFieldDescriptionForm = ({
disabled,
fieldMetadataItem,
}: SettingsDataModelFieldDescriptionFormProps) => {
+ const { t } = useLingui();
const { control } =
useFormContext<SettingsDataModelFieldDescriptionFormValues>();
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIsUniqueForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIsUniqueForm.tsx
index 9bae63ba399..63273baa008 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIsUniqueForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIsUniqueForm.tsx
@@ -5,10 +5,10 @@ import { useGetIsMetadataItemCustom } from '@/object-metadata/hooks/useGetIsMeta
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { SettingsOptionCardContentSelect } from '@/settings/components/SettingsOptions/SettingsOptionCardContentSelect';
import { canBeUnique } from '@/settings/data-model/fields/forms/utils/canBeUnique';
-import { t } from '@lingui/core/macro';
import { type FieldMetadataType } from 'twenty-shared/types';
import { IconKey } from 'twenty-ui/icon';
import { Switch } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
type SettingsDataModelFieldIsUniqueFormValues = {
isUnique: boolean;
@@ -27,6 +27,7 @@ export const SettingsDataModelFieldIsUniqueForm = ({
objectNameSingular,
disabled = false,
}: SettingsDataModelFieldIsUniqueFormProps) => {
+ const { t } = useLingui();
const { control } =
useFormContext<SettingsDataModelFieldIsUniqueFormValues>();
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsObjectNewFieldSelector.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsObjectNewFieldSelector.tsx
index a5b59fb492c..e2915c93414 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsObjectNewFieldSelector.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsObjectNewFieldSelector.tsx
@@ -12,7 +12,7 @@ import { type FieldType } from '@/settings/data-model/types/FieldType';
import { type SettingsFieldType } from '@/settings/data-model/types/SettingsFieldType';
import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';
import { styled } from '@linaria/react';
-import { msg, t } from '@lingui/core/macro';
+import { msg } from '@lingui/core/macro';
import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
import { Controller, useFormContext } from 'react-hook-form';
@@ -70,6 +70,7 @@ export const SettingsObjectNewFieldSelector = ({
excludedFieldTypes = [],
objectNamePlural,
}: SettingsObjectNewFieldSelectorProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const { i18n } = useLingui();
const { control, setValue } =
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/number/components/SettingsDataModelFieldNumberSettingsFormCard.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/number/components/SettingsDataModelFieldNumberSettingsFormCard.tsx
index f61d1d42ed8..6457b52c945 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/number/components/SettingsDataModelFieldNumberSettingsFormCard.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/number/components/SettingsDataModelFieldNumberSettingsFormCard.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { SettingsCardSeparator } from '@/settings/components/SettingsCardSeparator';
import { SettingsDataModelPreviewFormCard } from '@/settings/data-model/components/SettingsDataModelPreviewFormCard';
import { SettingsDataModelFieldIsUniqueForm } from '@/settings/data-model/fields/forms/components/SettingsDataModelFieldIsUniqueForm';
@@ -6,6 +5,7 @@ import { SettingsDataModelFieldNumberForm } from '@/settings/data-model/fields/f
import { SettingsDataModelFieldPreviewWidget } from '@/settings/data-model/fields/preview/components/SettingsDataModelFieldPreviewWidget';
import { useFormContext } from 'react-hook-form';
import { FieldMetadataType } from 'twenty-shared/types';
+import { useLingui } from '@lingui/react/macro';
type SettingsDataModelFieldNumberSettingsFormCardProps = {
disabled?: boolean;
@@ -18,6 +18,7 @@ export const SettingsDataModelFieldNumberSettingsFormCard = ({
existingFieldMetadataId,
objectNameSingular,
}: SettingsDataModelFieldNumberSettingsFormCardProps) => {
+ const { t } = useLingui();
const { watch } = useFormContext();
return (
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx
index d1b1cf02fa8..591de94b104 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx
@@ -25,7 +25,6 @@ import { TextArea } from '@/ui/input/components/TextArea';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
-import { t } from '@lingui/core/macro';
import { useEffect, useState } from 'react';
import { useSearchParams } from 'react-router-dom';
import { isDefined } from 'twenty-shared/utils';
@@ -43,6 +42,7 @@ import { Collapsible } from 'twenty-ui/primitives/layout';
import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
import { SettingsDataModelFieldSelectFormOptionRow } from './SettingsDataModelFieldSelectFormOptionRow';
+import { useLingui } from '@lingui/react/macro';
export const settingsDataModelFieldSelectFormSchema = z.object({
defaultValue: selectFieldDefaultValueSchema(),
@@ -128,6 +128,7 @@ export const SettingsDataModelFieldSelectForm = ({
fieldType,
disabled = false,
}: SettingsDataModelFieldSelectFormProps) => {
+ const { t } = useLingui();
const { initialDefaultValue, initialOptions } =
useSelectSettingsFormInitialValues({
fieldMetadataId: existingFieldMetadataId,
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx
index 447da687b3d..486dcb10fa3 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx
@@ -5,7 +5,6 @@ import { useColorLabels } from '@/ui/input/hooks/useColorLabels';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { LightIconButton } from 'twenty-ui/components/input';
import { Dropdown } from 'twenty-ui/components/navigation';
@@ -21,6 +20,7 @@ import { Collapsible } from 'twenty-ui/primitives/layout';
import { MAIN_COLOR_NAMES, useTheme, themeCssVariables } from 'twenty-ui/theme';
import { computeOptionValueFromLabel } from '@/object-metadata/utils/computeOptionValueFromLabel';
+import { useLingui } from '@lingui/react/macro';
type SettingsDataModelFieldSelectFormOptionRowProps = {
className?: string;
@@ -87,6 +87,7 @@ export const SettingsDataModelFieldSelectFormOptionRow = ({
isNewRow,
fieldIsNullable,
}: SettingsDataModelFieldSelectFormOptionRowProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const colorLabels = useColorLabels();
const SELECT_COLOR_DROPDOWN_ID = `select-color-dropdown-${option.id}`;
diff --git a/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverview.tsx b/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverview.tsx
index 4e185cde6d6..bcca76bf9c1 100644
--- a/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverview.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverview.tsx
@@ -4,7 +4,6 @@ import { SettingsDataModelOverviewRelationMarkers } from '@/settings/data-model/
import { calculateHandlePosition } from '@/settings/data-model/graph-overview/utils/calculateHandlePosition';
import { NavigationButton } from '@/ui/input/components/NavigationButton';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import {
Background,
type Edge,
@@ -35,6 +34,7 @@ import {
} from 'twenty-ui/icon';
import { ButtonGroup } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const nodeTypes: NodeTypes = {
object: SettingsDataModelOverviewObject,
@@ -73,6 +73,7 @@ const StyledCloseButton = styled.div`
`;
export const SettingsDataModelOverview = () => {
+ const { t } = useLingui();
const { fitView, zoomIn, zoomOut } = useReactFlow();
const [nodes, setNodes] = useNodesState<Node>([]);
diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx
index 0b25e69ccd7..64df3e08c7d 100644
--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import {
IconArchiveOff,
IconDotsVertical,
@@ -13,6 +12,7 @@ import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { type FieldMetadataType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type SettingsObjectFieldInactiveActionDropdownProps = {
isCustomField?: boolean;
@@ -34,6 +34,7 @@ export const SettingsObjectFieldInactiveActionDropdown = ({
isCustomField,
isSystemField,
}: SettingsObjectFieldInactiveActionDropdownProps) => {
+ const { t } = useLingui();
const isDeletable = isCustomField && !isSystemField;
return (
diff --git a/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsDataModelObjectSummary.tsx b/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsDataModelObjectSummary.tsx
index 001e15d5406..a04f9c2fe05 100644
--- a/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsDataModelObjectSummary.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsDataModelObjectSummary.tsx
@@ -1,12 +1,11 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
import { ObjectMetadataIcon } from '@/object-metadata/components/ObjectMetadataIcon';
import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
import { SettingsItemTypeTag } from '@/settings/components/SettingsItemTypeTag';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { IconBox } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
export type SettingsDataModelObjectPreviewProps = {
className?: string;
@@ -111,6 +110,7 @@ const SettingsDataModelObjectPreviewOtherObjects = ({
}: {
selected: number;
}) => {
+ const { t } = useLingui();
const theme = useTheme();
return (
diff --git a/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx b/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx
index e038670f023..ae2c3d76dea 100644
--- a/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import {
IconArchiveOff,
IconDotsVertical,
@@ -12,6 +11,7 @@ import { Dropdown } from 'twenty-ui/components/navigation';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
+import { useLingui } from '@lingui/react/macro';
type SettingsObjectInactiveMenuDropDownProps = {
isCustomObject: boolean;
@@ -30,6 +30,7 @@ export const SettingsObjectInactiveMenuDropDown = ({
isCustomObject,
isReadOnly = false,
}: SettingsObjectInactiveMenuDropDownProps) => {
+ const { t } = useLingui();
const isEditable = isCustomObject && !isReadOnly;
return (
diff --git a/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectIdentifiersForm.tsx b/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectIdentifiersForm.tsx
index 2436643d949..60aff8ff811 100644
--- a/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectIdentifiersForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectIdentifiersForm.tsx
@@ -10,7 +10,6 @@ import { Select } from '@/ui/input/components/Select';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { zodResolver } from '@hookform/resolvers/zod';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Controller, useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
import {
@@ -23,6 +22,7 @@ import { useIcons } from 'twenty-ui/icon/provider';
import { type SelectOption } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
import { type z } from 'zod';
+import { useLingui } from '@lingui/react/macro';
export const settingsDataModelObjectIdentifiersFormSchema =
objectMetadataItemSchema.pick({
@@ -51,6 +51,7 @@ const StyledContainer = styled.div`
export const SettingsDataModelObjectIdentifiersForm = ({
objectMetadataItem,
}: SettingsDataModelObjectIdentifiersFormProps) => {
+ const { t } = useLingui();
const isDDLLocked = useAtomStateValue(isDDLLockedState);
const getIsMetadataItemCustom = useGetIsMetadataItemCustom();
diff --git a/packages/twenty-front/src/modules/settings/developers/components/ApiKeyNameInput.tsx b/packages/twenty-front/src/modules/settings/developers/components/ApiKeyNameInput.tsx
index 50251670572..16c587a0ac8 100644
--- a/packages/twenty-front/src/modules/settings/developers/components/ApiKeyNameInput.tsx
+++ b/packages/twenty-front/src/modules/settings/developers/components/ApiKeyNameInput.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { useCallback, useEffect } from 'react';
import { useDebouncedCallback } from 'use-debounce';
@@ -8,6 +7,7 @@ import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
import { useMutation } from '@apollo/client/react';
import { UpdateApiKeyDocument } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledComboInputContainer = styled.div`
display: flex;
@@ -30,6 +30,7 @@ export const ApiKeyNameInput = ({
disabled,
onNameUpdate,
}: ApiKeyNameInputProps) => {
+ const { t } = useLingui();
const [updateApiKey] = useMutation(UpdateApiKeyDocument);
// TODO: Enhance this with react-web-hook-form (https://www.react-hook-form.com)
diff --git a/packages/twenty-front/src/modules/settings/developers/components/SettingsWebhooksTable.tsx b/packages/twenty-front/src/modules/settings/developers/components/SettingsWebhooksTable.tsx
index 491e6a64b8d..fb059449cad 100644
--- a/packages/twenty-front/src/modules/settings/developers/components/SettingsWebhooksTable.tsx
+++ b/packages/twenty-front/src/modules/settings/developers/components/SettingsWebhooksTable.tsx
@@ -1,6 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
import { SettingsDevelopersWebhookTableRow } from '@/settings/developers/components/SettingsDevelopersWebhookTableRow';
import { WEBHOOK_TABLE_ROW_GRID_TEMPLATE_COLUMNS } from '@/settings/developers/constants/WebhookTableRowGridTemplateColumns';
import { Table } from '@/ui/layout/table/components/Table';
@@ -12,6 +10,7 @@ import { getSettingsPath } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
import { useQuery } from '@apollo/client/react';
import { GetWebhooksDocument } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledTableBodyContainer = styled.div`
border-bottom: 1px solid ${themeCssVariables.border.color.light};
@@ -20,6 +19,7 @@ const StyledTableBodyContainer = styled.div`
`;
export const SettingsWebhooksTable = () => {
+ const { t } = useLingui();
const { data: webhooksData } = useQuery(GetWebhooksDocument);
const webhooks = webhooksData?.webhooks;
diff --git a/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx b/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx
index 6f5f8618fe6..81a4fb7a1d4 100644
--- a/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx
+++ b/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx
@@ -4,7 +4,6 @@ import { SelectControl } from '@/ui/input/components/SelectControl';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
@@ -17,6 +16,7 @@ import {
IconWebhook,
} from 'twenty-ui/icon';
import { type SelectOption } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
const WEBHOOK_ENTITY_DROPDOWN_ID = 'webhook-entity-select';
@@ -33,6 +33,7 @@ export const WebhookEntitySelect = ({
disabled = false,
dropdownId = WEBHOOK_ENTITY_DROPDOWN_ID,
}: WebhookEntitySelectProps) => {
+ const { t } = useLingui();
const { getSelectIconPropsFromObjectMetadataItem } =
useObjectMetadataSelectHelpers();
const [searchInput, setSearchInput] = useState('');
diff --git a/packages/twenty-front/src/modules/settings/developers/hooks/useOpenPlayground.ts b/packages/twenty-front/src/modules/settings/developers/hooks/useOpenPlayground.ts
index e7281b88d80..e6c23220fef 100644
--- a/packages/twenty-front/src/modules/settings/developers/hooks/useOpenPlayground.ts
+++ b/packages/twenty-front/src/modules/settings/developers/hooks/useOpenPlayground.ts
@@ -1,5 +1,4 @@
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useCallback } from 'react';
import { SettingsPath } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -14,11 +13,13 @@ import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { useToast } from 'twenty-ui/components/feedback';
import { GeneratePlaygroundTokenDocument } from '~/generated-metadata/graphql';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+import { useLingui } from '@lingui/react/macro';
// Re-mint when less than this remains so the user never lands on a token about to expire.
const TOKEN_FRESHNESS_BUFFER_MS = 5 * 60 * 1000;
export const useOpenPlayground = () => {
+ const { t } = useLingui();
const navigateSettings = useNavigateSettings();
const [playgroundApiKey, setPlaygroundApiKey] = useAtomState(
playgroundApiKeyState,
diff --git a/packages/twenty-front/src/modules/settings/developers/hooks/useWebhookForm.ts b/packages/twenty-front/src/modules/settings/developers/hooks/useWebhookForm.ts
index 59826841a6b..adc08569296 100644
--- a/packages/twenty-front/src/modules/settings/developers/hooks/useWebhookForm.ts
+++ b/packages/twenty-front/src/modules/settings/developers/hooks/useWebhookForm.ts
@@ -15,7 +15,6 @@ import {
type WebhookFormValues,
} from '@/settings/developers/validation-schemas/webhookFormSchema';
import { useMutation, useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { useToast } from 'twenty-ui/components/feedback';
import {
@@ -27,6 +26,7 @@ import {
} from '~/generated-metadata/graphql';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
import { SETTINGS_DEVELOPERS_TABS } from '@/settings/developers/constants/SettingsDevelopersTabs';
+import { useLingui } from '@lingui/react/macro';
type UseWebhookFormProps = {
webhookId?: string;
@@ -42,6 +42,7 @@ const DEFAULT_FORM_VALUES: WebhookFormValues = {
};
export const useWebhookForm = ({ webhookId, mode }: UseWebhookFormProps) => {
+ const { t } = useLingui();
const navigate = useNavigateSettings();
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/modules/settings/domains/components/SettingsDomainRecords.tsx b/packages/twenty-front/src/modules/settings/domains/components/SettingsDomainRecords.tsx
index 04c1e6ebf96..95bfae1e625 100644
--- a/packages/twenty-front/src/modules/settings/domains/components/SettingsDomainRecords.tsx
+++ b/packages/twenty-front/src/modules/settings/domains/components/SettingsDomainRecords.tsx
@@ -2,7 +2,6 @@ import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { SettingsDnsRecordsTable } from '@/settings/components/SettingsDnsRecordsTable';
-import { t } from '@lingui/core/macro';
import { Section } from 'twenty-ui/components/layout';
import { type ThemeColor } from 'twenty-ui/theme';
import {
@@ -10,12 +9,14 @@ import {
type DomainValidRecords,
} from '~/generated-metadata/graphql';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import { useLingui } from '@lingui/react/macro';
export const SettingsDomainRecords = ({
records,
}: {
records: DomainValidRecords['records'];
}) => {
+ const { t } = useLingui();
const currentWorkspace = useAtomStateValue(currentWorkspaceState);
const rowsDefinitions = [
diff --git a/packages/twenty-front/src/modules/settings/enterprise/components/OrganizationAdornment.tsx b/packages/twenty-front/src/modules/settings/enterprise/components/OrganizationAdornment.tsx
index fe123311c7b..4c784e427dd 100644
--- a/packages/twenty-front/src/modules/settings/enterprise/components/OrganizationAdornment.tsx
+++ b/packages/twenty-front/src/modules/settings/enterprise/components/OrganizationAdornment.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { css, cx } from '@linaria/core';
import { isNonEmptyString } from '@sniptt/guards';
import { Link } from 'react-router-dom';
@@ -11,6 +10,7 @@ import { themeCssVariables } from 'twenty-ui/theme';
import { billingState } from '@/client-config/states/billingState';
import { TooltipDelay } from '@/ui/layout/tooltip/constants/TooltipDelay';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import { useLingui } from '@lingui/react/macro';
const pillClassName = css`
align-items: center;
@@ -51,6 +51,7 @@ export const OrganizationAdornment = ({
tooltipContent,
iconOnly = false,
}: OrganizationAdornmentProps) => {
+ const { t } = useLingui();
const billing = useAtomStateValue(billingState);
const isBillingEnabled = billing?.isBillingEnabled ?? false;
const label = t`Organization`;
diff --git a/packages/twenty-front/src/modules/settings/event-logs/components/EventLogJsonCell.tsx b/packages/twenty-front/src/modules/settings/event-logs/components/EventLogJsonCell.tsx
index 0a1f99cc378..0fc4dbd2ec5 100644
--- a/packages/twenty-front/src/modules/settings/event-logs/components/EventLogJsonCell.tsx
+++ b/packages/twenty-front/src/modules/settings/event-logs/components/EventLogJsonCell.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useRef, useState } from 'react';
import { JsonDisplay } from '@/ui/field/display/components/JsonDisplay/JsonDisplay';
@@ -9,6 +8,7 @@ import { JsonTree } from 'twenty-ui/components/data-display';
import { themeCssVariables } from 'twenty-ui/theme';
import { type JsonValue } from 'type-fest';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
+import { useLingui } from '@lingui/react/macro';
type EventLogJsonCellProps = {
value: Record<string, unknown> | null | undefined;
@@ -23,6 +23,7 @@ const StyledEmptyCell = styled.span`
`;
export const EventLogJsonCell = ({ value }: EventLogJsonCellProps) => {
+ const { t } = useLingui();
const { copyToClipboard } = useCopyToClipboard();
const [isExpanded, setIsExpanded] = useState(false);
const anchorRef = useRef<HTMLDivElement>(null);
diff --git a/packages/twenty-front/src/modules/settings/experience/components/DateTimeSettingsCalendarStartDaySelect.tsx b/packages/twenty-front/src/modules/settings/experience/components/DateTimeSettingsCalendarStartDaySelect.tsx
index f4c0b0d7803..61188c479dc 100644
--- a/packages/twenty-front/src/modules/settings/experience/components/DateTimeSettingsCalendarStartDaySelect.tsx
+++ b/packages/twenty-front/src/modules/settings/experience/components/DateTimeSettingsCalendarStartDaySelect.tsx
@@ -2,9 +2,9 @@ import { useMemo } from 'react';
import { detectCalendarStartDay } from '@/localization/utils/detection/detectCalendarStartDay';
import { Select } from '@/ui/input/components/Select';
-import { t } from '@lingui/core/macro';
import { CalendarStartDay } from 'twenty-shared/constants';
import { type SelectOption } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
type DateTimeSettingsCalendarStartDaySelectProps = {
value: CalendarStartDay;
@@ -15,6 +15,7 @@ export const DateTimeSettingsCalendarStartDaySelect = ({
value,
onChange,
}: DateTimeSettingsCalendarStartDaySelectProps) => {
+ const { t } = useLingui();
const systemCalendarStartDay = CalendarStartDay[detectCalendarStartDay()];
const systemDayContextualText =
@@ -30,7 +31,7 @@ export const DateTimeSettingsCalendarStartDaySelect = ({
{ label: t`Monday`, value: CalendarStartDay.MONDAY },
{ label: t`Saturday`, value: CalendarStartDay.SATURDAY },
],
- [],
+ [t],
);
return (
diff --git a/packages/twenty-front/src/modules/settings/experience/components/DateTimeSettingsTimeZoneSelect.tsx b/packages/twenty-front/src/modules/settings/experience/components/DateTimeSettingsTimeZoneSelect.tsx
index 3ab7a5537bf..f74e0d228f8 100644
--- a/packages/twenty-front/src/modules/settings/experience/components/DateTimeSettingsTimeZoneSelect.tsx
+++ b/packages/twenty-front/src/modules/settings/experience/components/DateTimeSettingsTimeZoneSelect.tsx
@@ -2,8 +2,8 @@ import { detectTimeZone } from '@/localization/utils/detection/detectTimeZone';
import { findAvailableTimeZoneOption } from '@/localization/utils/findAvailableTimeZoneOption';
import { AVAILABLE_TIMEZONE_OPTIONS } from '@/localization/constants/AvailableTimezoneOptions';
import { Select } from '@/ui/input/components/Select';
-import { t } from '@lingui/core/macro';
import { type SelectOption } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
type DateTimeSettingsTimeZoneSelectProps = {
value?: string;
@@ -14,6 +14,7 @@ export const DateTimeSettingsTimeZoneSelect = ({
value = detectTimeZone(),
onChange,
}: DateTimeSettingsTimeZoneSelectProps) => {
+ const { t } = useLingui();
const systemTimeZone = detectTimeZone();
const systemTimeZoneOption = findAvailableTimeZoneOption(systemTimeZone);
diff --git a/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx b/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx
index cca9ffe2c61..5acde8af4aa 100644
--- a/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx
+++ b/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx
@@ -11,7 +11,6 @@ import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { type NavigationDrawerItemModifier } from '@/ui/navigation/navigation-drawer/types/NavigationDrawerItemModifier';
import { type NavigationDrawerItemIndentationLevel } from '@/ui/navigation/navigation-drawer/types/NavigationDrawerItemIndentationLevel';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import {
IconAppWindow,
@@ -39,6 +38,7 @@ import {
PermissionFlagType,
} from '~/generated-metadata/graphql';
import { openUrlInNewTab } from '~/utils/openUrlInNewTab';
+import { useLingui } from '@lingui/react/macro';
export type SettingsNavigationSection = {
label: string;
@@ -58,6 +58,7 @@ export type SettingsNavigationItem = {
};
const useSettingsNavigationItems = (): SettingsNavigationSection[] => {
+ const { t } = useLingui();
const billing = useAtomStateValue(billingState);
const { signOut } = useAuth();
const supportChat = useAtomStateValue(supportChatState);
diff --git a/packages/twenty-front/src/modules/settings/lab/hooks/useLabPublicFeatureFlags.ts b/packages/twenty-front/src/modules/settings/lab/hooks/useLabPublicFeatureFlags.ts
index a258d2efe36..a313b9688ad 100644
--- a/packages/twenty-front/src/modules/settings/lab/hooks/useLabPublicFeatureFlags.ts
+++ b/packages/twenty-front/src/modules/settings/lab/hooks/useLabPublicFeatureFlags.ts
@@ -1,7 +1,6 @@
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { labPublicFeatureFlagsState } from '@/client-config/states/labPublicFeatureFlagsState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { isDefined } from 'twenty-shared/utils';
@@ -10,8 +9,10 @@ import {
type FeatureFlagKey,
UpdateLabPublicFeatureFlagDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useLabPublicFeatureFlags = () => {
+ const { t } = useLingui();
const [error, setError] = useState<string | null>(null);
const [currentWorkspace, setCurrentWorkspace] = useAtomState(
currentWorkspaceState,
diff --git a/packages/twenty-front/src/modules/settings/legal/components/DpaDocumentPreview.tsx b/packages/twenty-front/src/modules/settings/legal/components/DpaDocumentPreview.tsx
index 50741acc56d..f8c3a4fc3c9 100644
--- a/packages/twenty-front/src/modules/settings/legal/components/DpaDocumentPreview.tsx
+++ b/packages/twenty-front/src/modules/settings/legal/components/DpaDocumentPreview.tsx
@@ -1,8 +1,8 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { themeCssVariables } from 'twenty-ui/theme';
import { type DpaDocument } from '@/settings/legal/types/Dpa';
+import { useLingui } from '@lingui/react/macro';
const StyledDocument = styled.div`
background: ${themeCssVariables.background.primary};
@@ -59,27 +59,30 @@ type DpaDocumentPreviewProps = {
document: DpaDocument;
};
-export const DpaDocumentPreview = ({ document }: DpaDocumentPreviewProps) => (
- // tabIndex makes the scrollable region focusable so keyboard-only users can
- // scroll the agreement with the arrow keys.
- <StyledDocument tabIndex={0} role="region" aria-label={document.title}>
- <StyledTitle>{document.title}</StyledTitle>
- <StyledLastUpdated>{t`Last Updated: ${document.lastUpdatedLabel}`}</StyledLastUpdated>
- {document.blocks.map((block, index) => {
- if (block.kind === 'heading') {
- return <StyledHeading key={index}>{block.text}</StyledHeading>;
- }
+export const DpaDocumentPreview = ({ document }: DpaDocumentPreviewProps) => {
+ const { t } = useLingui();
+ return (
+ // tabIndex makes the scrollable region focusable so keyboard-only users can
+ // scroll the agreement with the arrow keys.
+ <StyledDocument tabIndex={0} role="region" aria-label={document.title}>
+ <StyledTitle>{document.title}</StyledTitle>
+ <StyledLastUpdated>{t`Last Updated: ${document.lastUpdatedLabel}`}</StyledLastUpdated>
+ {document.blocks.map((block, index) => {
+ if (block.kind === 'heading') {
+ return <StyledHeading key={index}>{block.text}</StyledHeading>;
+ }
- if (block.kind === 'signatureField') {
- return (
- <StyledSignatureField key={index}>
- <StyledSignatureLabel>{block.label}</StyledSignatureLabel>
- <StyledSignatureValue>{block.value}</StyledSignatureValue>
- </StyledSignatureField>
- );
- }
+ if (block.kind === 'signatureField') {
+ return (
+ <StyledSignatureField key={index}>
+ <StyledSignatureLabel>{block.label}</StyledSignatureLabel>
+ <StyledSignatureValue>{block.value}</StyledSignatureValue>
+ </StyledSignatureField>
+ );
+ }
- return <StyledParagraph key={index}>{block.text}</StyledParagraph>;
- })}
- </StyledDocument>
-);
+ return <StyledParagraph key={index}>{block.text}</StyledParagraph>;
+ })}
+ </StyledDocument>
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionLabelContainer.tsx b/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionLabelContainer.tsx
index 290063cafe4..2b3b6c6aa68 100644
--- a/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionLabelContainer.tsx
+++ b/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionLabelContainer.tsx
@@ -1,5 +1,5 @@
import { SettingsEditableTitle } from '@/settings/components/SettingsEditableTitle';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type SettingsLogicFunctionLabelContainerProps = {
value: string;
@@ -12,6 +12,7 @@ export const SettingsLogicFunctionLabelContainer = ({
onChange,
readonly = false,
}: SettingsLogicFunctionLabelContainerProps) => {
+ const { t } = useLingui();
return (
<SettingsEditableTitle
instanceId="logic-function-name-input"
diff --git a/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionNewForm.tsx b/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionNewForm.tsx
index 72052262b4a..09c42fb7756 100644
--- a/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionNewForm.tsx
+++ b/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionNewForm.tsx
@@ -3,11 +3,11 @@ import { SettingsOptionCardContentCounter } from '@/settings/components/Settings
import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';
import { TextArea } from '@/ui/input/components/TextArea';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Section } from 'twenty-ui/components/layout';
import { IconClockHour8 } from 'twenty-ui/icon';
import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledInputsContainer = styled.div`
display: flex;
@@ -26,6 +26,7 @@ export const SettingsLogicFunctionNewForm = ({
) => (value: LogicFunctionFormValues[TKey]) => void;
readonly?: boolean;
}) => {
+ const { t } = useLingui();
const descriptionTextAreaId = `${formValues.name}-description`;
const nameTextInputId = `${formValues.name}-name`;
diff --git a/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx b/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
index b446610147d..ef584721915 100644
--- a/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
+++ b/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
@@ -5,12 +5,12 @@ import { TabList } from '@/ui/layout/tab-list/components/TabList';
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
import { CodeEditorHeader } from 'twenty-ui/components/code-editor';
import { IconPlayerPlay } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
const StyledTabListContainer = styled.div`
> * {
@@ -31,6 +31,7 @@ export const SettingsLogicFunctionCodeEditorTab = ({
isTesting?: boolean;
applicationVariableKeys?: string[];
}) => {
+ const { t } = useLingui();
const activeTabId = useAtomComponentStateValue(
activeTabIdComponentState,
SETTINGS_LOGIC_FUNCTION_TAB_LIST_COMPONENT_ID,
diff --git a/packages/twenty-front/src/modules/settings/mcp/components/SettingsMcpSetup.tsx b/packages/twenty-front/src/modules/settings/mcp/components/SettingsMcpSetup.tsx
index 8ebaefb601c..2a49aa95cd4 100644
--- a/packages/twenty-front/src/modules/settings/mcp/components/SettingsMcpSetup.tsx
+++ b/packages/twenty-front/src/modules/settings/mcp/components/SettingsMcpSetup.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Fragment } from 'react';
import { LightCopyIconButton } from '@/ui/input/components/LightCopyIconButton';
@@ -15,6 +14,7 @@ import { Section } from 'twenty-ui/components/layout';
import { CodeEditor, CodeEditorHeader } from 'twenty-ui/components/code-editor';
import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme';
import { REACT_APP_SERVER_BASE_URL } from '~/config';
+import { useLingui } from '@lingui/react/macro';
const StyledMcpEditorHeaderTitle = styled.div`
align-items: center;
@@ -46,6 +46,7 @@ const StyledCardsGrid = styled.div`
`;
export const SettingsMcpSetup = () => {
+ const { t } = useLingui();
const mcpServerUrl = buildMcpServerUrl(REACT_APP_SERVER_BASE_URL);
const mcpConfig = buildMcpConfig(mcpServerUrl);
const categories = buildMcpSetupCategories({
diff --git a/packages/twenty-front/src/modules/settings/members/components/MemberInfosTab.tsx b/packages/twenty-front/src/modules/settings/members/components/MemberInfosTab.tsx
index 82068f4ad3b..13daf5581c1 100644
--- a/packages/twenty-front/src/modules/settings/members/components/MemberInfosTab.tsx
+++ b/packages/twenty-front/src/modules/settings/members/components/MemberInfosTab.tsx
@@ -6,11 +6,11 @@ import { MemberNameFields } from '@/settings/members/components/MemberNameFields
import { MemberTwoFactorAuthenticationRecoverySection } from '@/settings/members/components/MemberTwoFactorAuthenticationRecoverySection';
import { WorkspaceMemberPictureUploader } from '@/settings/workspace-member/components/WorkspaceMemberPictureUploader';
import { type WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
import { Button } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type MemberInfosTabProps = {
member: WorkspaceMember;
@@ -38,6 +38,7 @@ export const MemberInfosTab = ({
onDelete,
twoFactorAuthenticationRecoveryUserId,
}: MemberInfosTabProps) => {
+ const { t } = useLingui();
const [firstName, setFirstName] = useState(member.name.firstName);
const [lastName, setLastName] = useState(member.name.lastName);
const [avatarUrl, setAvatarUrl] = useState<string | null>(
diff --git a/packages/twenty-front/src/modules/settings/members/components/MemberNameFields.tsx b/packages/twenty-front/src/modules/settings/members/components/MemberNameFields.tsx
index a09c98c73a8..96bc950ee20 100644
--- a/packages/twenty-front/src/modules/settings/members/components/MemberNameFields.tsx
+++ b/packages/twenty-front/src/modules/settings/members/components/MemberNameFields.tsx
@@ -1,5 +1,5 @@
import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type MemberNameFieldsProps = {
memberId: string;
@@ -14,6 +14,7 @@ export const MemberNameFields = ({
lastName,
onChange,
}: MemberNameFieldsProps) => {
+ const { t } = useLingui();
const firstNameInstanceId = `${memberId}-first-name`;
const lastNameInstanceId = `${memberId}-last-name`;
diff --git a/packages/twenty-front/src/modules/settings/members/components/MemberPermissionsTab.tsx b/packages/twenty-front/src/modules/settings/members/components/MemberPermissionsTab.tsx
index 6966ce01af3..4cb5ece83cb 100644
--- a/packages/twenty-front/src/modules/settings/members/components/MemberPermissionsTab.tsx
+++ b/packages/twenty-front/src/modules/settings/members/components/MemberPermissionsTab.tsx
@@ -6,7 +6,6 @@ import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
import { type WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
import { useMutation } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { SettingsPath } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -18,6 +17,7 @@ import { Button } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
import { UpdateWorkspaceMemberRoleDocument } from '~/generated-metadata/graphql';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+import { useLingui } from '@lingui/react/macro';
const CONFIRM_ROLE_CHANGE_MODAL_ID = 'confirm-role-change-modal';
@@ -51,6 +51,7 @@ export const MemberPermissionsTab = ({
roles,
allRoles,
}: MemberPermissionsTabProps) => {
+ const { t } = useLingui();
const primaryRole = roles?.[0];
const { getIcon } = useIcons();
const navigateSettings = useNavigateSettings();
diff --git a/packages/twenty-front/src/modules/settings/members/components/MemberTwoFactorAuthenticationRecoverySection.tsx b/packages/twenty-front/src/modules/settings/members/components/MemberTwoFactorAuthenticationRecoverySection.tsx
index 568539c7e42..87f15daa94e 100644
--- a/packages/twenty-front/src/modules/settings/members/components/MemberTwoFactorAuthenticationRecoverySection.tsx
+++ b/packages/twenty-front/src/modules/settings/members/components/MemberTwoFactorAuthenticationRecoverySection.tsx
@@ -5,7 +5,6 @@ import { useGeneratedRecoveryCode } from '@/settings/two-factor-authentication/h
import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
import { useMutation, useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
@@ -19,6 +18,7 @@ import {
TwoFactorAuthenticationRecoveryStatusDocument,
} from '~/generated-metadata/graphql';
import { beautifyExactDateTime } from '~/utils/date-utils';
+import { useLingui } from '@lingui/react/macro';
const StyledContent = styled.div`
display: flex;
@@ -46,6 +46,7 @@ export const MemberTwoFactorAuthenticationRecoverySection = ({
userId,
memberName,
}: MemberTwoFactorAuthenticationRecoverySectionProps) => {
+ const { t } = useLingui();
const generateRecoveryCodeDialogId = `member-two-factor-authentication-recovery-code-dialog-${userId}`;
const { openDialog } = useDialog();
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/modules/settings/members/hooks/useUploadWorkspaceMemberProfilePicture.ts b/packages/twenty-front/src/modules/settings/members/hooks/useUploadWorkspaceMemberProfilePicture.ts
index 2a0d6da657e..a8e24294426 100644
--- a/packages/twenty-front/src/modules/settings/members/hooks/useUploadWorkspaceMemberProfilePicture.ts
+++ b/packages/twenty-front/src/modules/settings/members/hooks/useUploadWorkspaceMemberProfilePicture.ts
@@ -1,5 +1,4 @@
import { useDirectFileUpload } from '@/file/hooks/useDirectFileUpload';
-import { t } from '@lingui/core/macro';
import { useMutation } from '@apollo/client/react';
import { isDefined } from 'twenty-shared/utils';
import {
@@ -7,12 +6,14 @@ import {
FileFolder,
type FileWithSignedUrl,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type UploadWorkspaceMemberProfilePictureOptions = {
signal?: AbortSignal;
};
export const useUploadWorkspaceMemberProfilePicture = () => {
+ const { t } = useLingui();
const { createFileUploadAndPutFile } = useDirectFileUpload();
const [completeWorkspaceMemberProfilePictureUpload] = useMutation(
CompleteWorkspaceMemberProfilePictureUploadDocument,
diff --git a/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx
index 2fd4f381d1d..f78f9a69087 100644
--- a/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx
@@ -1,7 +1,6 @@
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useToast } from 'twenty-ui/components/feedback';
import { LightIconButton } from 'twenty-ui/components/input';
import { Dropdown } from 'twenty-ui/components/navigation';
@@ -10,6 +9,7 @@ import {
CurrentUserSessionsDocument,
RevokeUserSessionDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type SettingsDeviceSessionRowDropdownMenuProps = {
userSessionId: string;
@@ -18,6 +18,7 @@ type SettingsDeviceSessionRowDropdownMenuProps = {
export const SettingsDeviceSessionRowDropdownMenu = ({
userSessionId,
}: SettingsDeviceSessionRowDropdownMenuProps) => {
+ const { t } = useLingui();
const dropdownId = `settings-device-session-row-${userSessionId}`;
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/modules/settings/profile/hooks/useUpdateEmail.ts b/packages/twenty-front/src/modules/settings/profile/hooks/useUpdateEmail.ts
index 466bebac2c0..3e3486e7210 100644
--- a/packages/twenty-front/src/modules/settings/profile/hooks/useUpdateEmail.ts
+++ b/packages/twenty-front/src/modules/settings/profile/hooks/useUpdateEmail.ts
@@ -1,15 +1,14 @@
import { CombinedGraphQLErrors } from '@apollo/client/errors';
-
-import { t } from '@lingui/core/macro';
-
import { currentUserState } from '@/auth/states/currentUserState';
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useMutation } from '@apollo/client/react';
import { useToast } from 'twenty-ui/components/feedback';
import { UpdateUserEmailDocument } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useUpdateEmail = () => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const currentUser = useAtomStateValue(currentUserState);
diff --git a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesDefaultRole.tsx b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesDefaultRole.tsx
index c455cac75ab..1335bd8c94c 100644
--- a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesDefaultRole.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesDefaultRole.tsx
@@ -6,7 +6,6 @@ import { SettingsOptionCardContentSelect } from '@/settings/components/SettingsO
import { type RoleWithPartialMembers } from '@/settings/roles/types/RoleWithPartialMembers';
import { Select } from '@/ui/input/components/Select';
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
import { IconUserPin } from 'twenty-ui/icon';
@@ -17,6 +16,7 @@ import {
type UpdateWorkspaceMutation,
UpdateWorkspaceDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type SettingsRoleDefaultRoleProps = {
roles: RoleWithPartialMembers[];
@@ -25,6 +25,7 @@ type SettingsRoleDefaultRoleProps = {
export const SettingsRoleDefaultRole = ({
roles,
}: SettingsRoleDefaultRoleProps) => {
+ const { t } = useLingui();
const [updateWorkspace] = useMutation(UpdateWorkspaceDocument);
const [currentWorkspace, setCurrentWorkspace] = useAtomState(
diff --git a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesList.tsx b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesList.tsx
index ae9182eb86e..b32843768ca 100644
--- a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesList.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesList.tsx
@@ -14,7 +14,6 @@ import { TableFooter } from '@/ui/layout/table/components/TableFooter';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { checkIfBillingEntitlementIsEnabledOnWorkspace } from '@/workspace/utils/checkIfBillingEntitlementIsEnabledOnWorkspace';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { SettingsPath } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -34,6 +33,7 @@ import { themeCssVariables } from 'twenty-ui/theme';
import { BillingEntitlementKey } from '~/generated-metadata/graphql';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
import { sortByAscString } from '~/utils/array/sortByAscString';
+import { useLingui } from '@lingui/react/macro';
const StyledTableRows = styled.div`
padding-bottom: ${themeCssVariables.spacing[2]};
@@ -58,6 +58,7 @@ const StyledCreateRoleContainer = styled.div`
`;
export const SettingsRolesList = () => {
+ const { t } = useLingui();
const navigateSettings = useNavigateSettings();
const [searchTerm, setSearchTerm] = useState('');
const [showAgentRoles, setShowAgentRoles] = useState(false);
diff --git a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsx b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsx
index 408d92a7878..8477bcdeeda 100644
--- a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsx
@@ -3,7 +3,6 @@ import { currentWorkspaceMembersState } from '@/auth/states/currentWorkspaceMemb
import { type RoleWithPartialMembers } from '@/settings/roles/types/RoleWithPartialMembers';
import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableRow } from '@/ui/layout/table/components/TableRow';
-import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { SettingsPath } from 'twenty-shared/types';
@@ -12,6 +11,7 @@ import { IconChevronRight, IconLock } from 'twenty-ui/icon';
import { useIcons } from 'twenty-ui/icon/provider';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { WorkspaceMemberAvatarStack } from '@/workspace-member/components/WorkspaceMemberAvatarStack';
+import { useLingui } from '@lingui/react/macro';
const StyledNameCell = styled.div`
color: ${themeCssVariables.font.color.primary};
@@ -46,6 +46,7 @@ type SettingsRolesTableRowProps = {
const MAX_VISIBLE_ROLE_MEMBER_AVATARS = 5;
export const SettingsRolesTableRow = ({ role }: SettingsRolesTableRowProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const { getIcon } = useIcons();
const Icon = getIcon(role.icon ?? 'IconUser');
diff --git a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentConfirmationModal.tsx b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentConfirmationModal.tsx
index bd31ee42e37..96314400b7e 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentConfirmationModal.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentConfirmationModal.tsx
@@ -1,7 +1,7 @@
import { SettingsRoleAssignmentConfirmationModalSubtitle } from '@/settings/roles/role-assignment/components/SettingsRoleAssignmentConfirmationModalSubtitle';
import { type SettingsRoleAssignmentConfirmationModalSelectedRoleTarget } from '@/settings/roles/role-assignment/types/SettingsRoleAssignmentConfirmationModalSelectedRoleTarget';
import { ConfirmationDialog } from '@/ui/layout/dialog/components/ConfirmationDialog';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type SettingsRoleAssignmentConfirmationModalProps = {
modalInstanceId: string;
@@ -20,6 +20,7 @@ export const SettingsRoleAssignmentConfirmationModal = ({
onRoleClick,
newRoleName,
}: SettingsRoleAssignmentConfirmationModalProps) => {
+ const { t } = useLingui();
const roleTargetName = selectedRoleTarget.name;
const title = t`Assign ${roleTargetName}?`;
diff --git a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentConfirmationModalSubtitle.tsx b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentConfirmationModalSubtitle.tsx
index 69a3ba2ef0a..e57c5a062fa 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentConfirmationModalSubtitle.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentConfirmationModalSubtitle.tsx
@@ -3,11 +3,11 @@ import { SettingsCard } from '@/settings/components/SettingsCard';
import { type SettingsRoleAssignmentConfirmationModalSelectedRoleTarget } from '@/settings/roles/role-assignment/types/SettingsRoleAssignmentConfirmationModalSelectedRoleTarget';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Avatar } from 'twenty-ui/primitives/data-display';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { themeCssVariables } from 'twenty-ui/theme';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
+import { useLingui } from '@lingui/react/macro';
const StyledSettingsCardContainer = styled.div`
margin-top: ${themeCssVariables.spacing[6]};
@@ -22,6 +22,7 @@ export const SettingsRoleAssignmentConfirmationModalSubtitle = ({
selectedRoleTarget,
onRoleClick,
}: SettingsRoleAssignmentConfirmationModalSubtitleProps) => {
+ const { t } = useLingui();
const currentWorkspaceMembers = useAtomStateValue(
currentWorkspaceMembersState,
);
diff --git a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTable.tsx b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTable.tsx
index 15ce6169a40..6dd27455d21 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTable.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTable.tsx
@@ -9,7 +9,6 @@ import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useMemo, useState } from 'react';
import { Section } from 'twenty-ui/components/layout';
@@ -19,6 +18,7 @@ import { type ApiKeyForRole } from '~/generated-metadata/graphql';
import { type PartialWorkspaceMember } from '@/settings/roles/types/RoleWithPartialMembers';
import { themeCssVariables } from 'twenty-ui/theme';
import { normalizeSearchText } from 'twenty-ui/utilities';
+import { useLingui } from '@lingui/react/macro';
const StyledTable = styled.div`
border-bottom: 1px solid ${themeCssVariables.border.color.light};
@@ -51,6 +51,7 @@ export const SettingsRoleAssignmentTable = <T extends RoleTargetType>({
roleTargetType,
roleId,
}: SettingsRoleAssignmentTableProps<T>) => {
+ const { t } = useLingui();
const settingsDraftRole = useAtomFamilyStateValue(
settingsDraftRoleFamilyState,
roleId,
diff --git a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableRow.tsx b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableRow.tsx
index 16701e5d6a6..0a87b3e6a0f 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableRow.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableRow.tsx
@@ -5,7 +5,6 @@ import { TableRow } from '@/ui/layout/table/components/TableRow';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { UserContext } from '@/users/contexts/UserContext';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { IconKey } from 'twenty-ui/icon';
@@ -17,6 +16,7 @@ import { type ApiKeyForRole } from '~/generated-metadata/graphql';
import { dateLocaleState } from '@/localization/states/dateLocaleState';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
import { formatDateString } from '@/object-record/record-field/ui/utils/formatDateString';
+import { useLingui } from '@lingui/react/macro';
const StyledIconWrapper = styled.div`
align-items: center;
@@ -50,6 +50,7 @@ type SettingsRoleAssignmentTableRowProps = {
export const SettingsRoleAssignmentTableRow = ({
roleTarget,
}: SettingsRoleAssignmentTableRowProps) => {
+ const { t } = useLingui();
const currentWorkspaceMembers = useAtomStateValue(
currentWorkspaceMembersState,
);
diff --git a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentWorkspaceMemberPickerDropdownContent.tsx b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentWorkspaceMemberPickerDropdownContent.tsx
index 6c3cdf7b992..cfb763f1cea 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentWorkspaceMemberPickerDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentWorkspaceMemberPickerDropdownContent.tsx
@@ -1,11 +1,11 @@
import { currentWorkspaceMembersState } from '@/auth/states/currentWorkspaceMembersState';
import { type PartialWorkspaceMember } from '@/settings/roles/types/RoleWithPartialMembers';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
import { Avatar } from 'twenty-ui/primitives/data-display';
import { type SearchRecord } from '~/generated/graphql';
+import { useLingui } from '@lingui/react/macro';
type SettingsRoleAssignmentWorkspaceMemberPickerDropdownContentProps = {
loading: boolean;
@@ -20,6 +20,7 @@ export const SettingsRoleAssignmentWorkspaceMemberPickerDropdownContent = ({
filteredWorkspaceMembers,
onSelect,
}: SettingsRoleAssignmentWorkspaceMemberPickerDropdownContentProps) => {
+ const { t } = useLingui();
const currentWorkspaceMembers = useAtomStateValue(
currentWorkspaceMembersState,
);
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/agent-chat-channels/components/SettingsRolePermissionsAgentChatChannelsSection.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/agent-chat-channels/components/SettingsRolePermissionsAgentChatChannelsSection.tsx
index af24bc774e8..398333fe734 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/agent-chat-channels/components/SettingsRolePermissionsAgentChatChannelsSection.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/agent-chat-channels/components/SettingsRolePermissionsAgentChatChannelsSection.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
import { IconHash } from 'twenty-ui/icon';
@@ -18,6 +17,7 @@ import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
+import { useLingui } from '@lingui/react/macro';
const StyledCardContainer = styled.div`
margin-bottom: ${themeCssVariables.spacing[4]};
@@ -41,6 +41,7 @@ export const SettingsRolePermissionsAgentChatChannelsSection = ({
roleId,
isEditable,
}: SettingsRolePermissionsAgentChatChannelsSectionProps) => {
+ const { t } = useLingui();
const settingsDraftRole = useAtomFamilyStateValue(
settingsDraftRoleFamilyState,
roleId,
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelObjectPicker.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelObjectPicker.tsx
index c549248db47..01b6691da4d 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelObjectPicker.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelObjectPicker.tsx
@@ -6,7 +6,6 @@ import { useFilterObjectMetadataItemsWithPermissionOverride } from '@/settings/r
import { useObjectMetadataItemsThatCanHavePermission } from '@/settings/roles/role-permissions/object-level-permissions/hooks/useObjectMetadataItemsThatCanHavePermission';
import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { useSearchParams } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
@@ -14,6 +13,7 @@ import { Section } from 'twenty-ui/components/layout';
import { IconSearch } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+import { useLingui } from '@lingui/react/macro';
const StyledTypeSelectContainer = styled.div`
display: flex;
@@ -53,6 +53,7 @@ export const SettingsRolePermissionsObjectLevelObjectPicker = ({
}: {
roleId: string;
}) => {
+ const { t } = useLingui();
const theme = useTheme();
const navigate = useNavigateSettings();
const getIsMetadataItemCustom = useGetIsMetadataItemCustom();
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelOverrideCell.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelOverrideCell.tsx
index a222a632508..5998815e14a 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelOverrideCell.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelOverrideCell.tsx
@@ -7,9 +7,9 @@ import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDr
import { TooltipDelay } from '@/ui/layout/tooltip/constants/TooltipDelay';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { Tooltip } from 'twenty-ui/primitives/surfaces';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: flex;
@@ -28,6 +28,7 @@ export const SettingsRolePermissionsObjectLevelOverrideCell = ({
roleId,
objectLabel,
}: SettingsRolePermissionsObjectLevelOverrideCellProps) => {
+ const { t } = useLingui();
const settingsDraftRole = useAtomFamilyStateValue(
settingsDraftRoleFamilyState,
roleId,
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelSection.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelSection.tsx
index c7436c78949..446e0fba684 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelSection.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelSection.tsx
@@ -8,7 +8,6 @@ import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAto
import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableFooter } from '@/ui/layout/table/components/TableFooter';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
@@ -16,6 +15,7 @@ import { IconPlus } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+import { useLingui } from '@lingui/react/macro';
const StyledTableRows = styled.div`
padding-bottom: ${themeCssVariables.spacing[2]};
@@ -33,6 +33,7 @@ export const SettingsRolePermissionsObjectLevelSection = ({
fromAgentId,
isEditable,
}: SettingsRolePermissionsObjectLevelSectionProps) => {
+ const { t } = useLingui();
const navigateSettings = useNavigateSettings();
const settingsDraftRole = useAtomFamilyStateValue(
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableHeader.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableHeader.tsx
index 15afad8384e..2b504f52a5c 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableHeader.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableHeader.tsx
@@ -1,7 +1,7 @@
import { OBJECT_LEVEL_PERMISSION_TABLE_GRID_AUTO_COLUMNS } from '@/settings/roles/role-permissions/object-level-permissions/constants/ObjectLevelPermissionTableGridAutoColumns';
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type SettingsRolePermissionsObjectLevelTableHeaderProps = {
showPermissionsLabel?: boolean;
@@ -9,13 +9,16 @@ type SettingsRolePermissionsObjectLevelTableHeaderProps = {
export const SettingsRolePermissionsObjectLevelTableHeader = ({
showPermissionsLabel = true,
-}: SettingsRolePermissionsObjectLevelTableHeaderProps) => (
- <TableRow gridAutoColumns={OBJECT_LEVEL_PERMISSION_TABLE_GRID_AUTO_COLUMNS}>
- <TableHeader>{t`Object-Level`}</TableHeader>
- <TableHeader>{showPermissionsLabel ? t`Records` : ''}</TableHeader>
- <TableHeader>{showPermissionsLabel ? t`See Fields` : ''}</TableHeader>
- <TableHeader>{showPermissionsLabel ? t`Edit Fields` : ''}</TableHeader>
- <TableHeader></TableHeader>
- <TableHeader></TableHeader>
- </TableRow>
-);
+}: SettingsRolePermissionsObjectLevelTableHeaderProps) => {
+ const { t } = useLingui();
+ return (
+ <TableRow gridAutoColumns={OBJECT_LEVEL_PERMISSION_TABLE_GRID_AUTO_COLUMNS}>
+ <TableHeader>{t`Object-Level`}</TableHeader>
+ <TableHeader>{showPermissionsLabel ? t`Records` : ''}</TableHeader>
+ <TableHeader>{showPermissionsLabel ? t`See Fields` : ''}</TableHeader>
+ <TableHeader>{showPermissionsLabel ? t`Edit Fields` : ''}</TableHeader>
+ <TableHeader></TableHeader>
+ <TableHeader></TableHeader>
+ </TableRow>
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRowOptionsDropdown.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRowOptionsDropdown.tsx
index 477cdfa1c97..4105a62aa0c 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRowOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRowOptionsDropdown.tsx
@@ -1,11 +1,11 @@
import { useResetObjectPermission } from '@/settings/roles/role-permissions/object-level-permissions/hooks/useResetObjectPermission';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
-import { t } from '@lingui/core/macro';
import { Link } from 'react-router-dom';
import { IconButton } from 'twenty-ui/components/input';
import { Dropdown } from 'twenty-ui/components/navigation';
import { IconDotsVertical, IconPencil, IconTrash } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type SettingsRolePermissionsObjectLevelTableRowOptionsDropdownProps = {
roleId: string;
@@ -20,6 +20,7 @@ export const SettingsRolePermissionsObjectLevelTableRowOptionsDropdown = ({
objectPermissionDetailUrl,
isEditable,
}: SettingsRolePermissionsObjectLevelTableRowOptionsDropdownProps) => {
+ const { t } = useLingui();
const dropdownId = `settings-role-object-level-options-${objectMetadataId}`;
const { resetObjectPermission } = useResetObjectPermission(roleId);
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectForm.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectForm.tsx
index a389f0d4b88..42d6f2cb706 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectForm.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectForm.tsx
@@ -12,7 +12,6 @@ import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDr
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
import { SettingsWizardStepBar } from '@/settings/components/layout/SettingsWizardStepBar';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
-import { t } from '@lingui/core/macro';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { SettingsPath } from 'twenty-shared/types';
@@ -28,6 +27,7 @@ import {
BillingEntitlementKey,
FindOneAgentDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type SettingsRolePermissionsObjectLevelObjectFormProps = {
roleId: string;
@@ -38,6 +38,7 @@ export const SettingsRolePermissionsObjectLevelObjectForm = ({
roleId,
objectMetadataId,
}: SettingsRolePermissionsObjectLevelObjectFormProps) => {
+ const { t } = useLingui();
const [searchParams] = useSearchParams();
const navigate = useNavigate();
const fromAgentId = searchParams.get('fromAgent');
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevel.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevel.tsx
index d699a63069f..bf780a3ea3f 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevel.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevel.tsx
@@ -5,9 +5,9 @@ import { type SettingsRolePermissionsObjectLevelPermission } from '@/settings/ro
import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDraftRoleFamilyState';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Section } from 'twenty-ui/components/layout';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledTable = styled.div`
border-bottom: 1px solid ${themeCssVariables.border.color.light};
@@ -27,6 +27,7 @@ export const SettingsRolePermissionsObjectLevelObjectFormObjectLevel = ({
roleId,
objectMetadataItem,
}: SettingsRolePermissionsObjectLevelObjectFormObjectLevelProps) => {
+ const { t } = useLingui();
const settingsDraftRole = useAtomFamilyStateValue(
settingsDraftRoleFamilyState,
roleId,
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableHeader.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableHeader.tsx
index 43ff79a2c34..8ab25ee9398 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableHeader.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableHeader.tsx
@@ -1,11 +1,14 @@
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
export const SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableHeader =
- () => (
- <TableRow gridAutoColumns="1fr 48px">
- <TableHeader>{t`Name`}</TableHeader>
- <TableHeader aria-label={t`Actions`}></TableHeader>
- </TableRow>
- );
+ () => {
+ const { t } = useLingui();
+ return (
+ <TableRow gridAutoColumns="1fr 48px">
+ <TableHeader>{t`Name`}</TableHeader>
+ <TableHeader aria-label={t`Actions`}></TableHeader>
+ </TableRow>
+ );
+ };
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableRow.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableRow.tsx
index 29652ae232a..795c20816a6 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableRow.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableRow.tsx
@@ -10,10 +10,10 @@ import { TableCell } from '@/ui/layout/table/components/TableCell';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
import { type ObjectPermission, type Role } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledPermissionContent = styled.div`
align-items: center;
@@ -52,6 +52,7 @@ export const SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableRow =
settingsDraftRoleObjectPermissions,
roleId,
}: SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableRowProps) => {
+ const { t } = useLingui();
const settingsDraftRole = useAtomFamilyStateValue(
settingsDraftRoleFamilyState,
roleId,
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelect.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelect.tsx
index 344412e5fa1..b28e66683b7 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelect.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelect.tsx
@@ -1,7 +1,6 @@
/* @license Enterprise */
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Dropdown } from 'twenty-ui/components/navigation';
import { AdvancedFilterFieldSelectDropdownButtonClickableSelect } from '@/object-record/advanced-filter/components/AdvancedFilterFieldSelectDropdownButtonClickableSelect';
@@ -11,6 +10,7 @@ import { SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectDropd
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
flex: 2;
@@ -25,6 +25,7 @@ export const SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelect
({
recordFilterId,
}: SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectProps) => {
+ const { t } = useLingui();
const { advancedFilterFieldSelectDropdownId } =
useAdvancedFilterFieldSelectDropdown(recordFilterId);
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectSubFieldMenu.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectSubFieldMenu.tsx
index dcad67d502b..6ee19bbdcf8 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectSubFieldMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectSubFieldMenu.tsx
@@ -1,6 +1,4 @@
/* @license Enterprise */
-
-import { t } from '@lingui/core/macro';
import {
FieldMetadataType,
compositeTypeDefinitions,
@@ -17,6 +15,7 @@ import { ICON_NAME_BY_SUB_FIELD } from '@/object-record/record-filter/constants/
import { SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS } from '@/settings/data-model/constants/SettingsCompositeFieldTypeConfigs';
import { type CompositeFieldSubFieldName } from '@/settings/data-model/types/CompositeFieldSubFieldName';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { useLingui } from '@lingui/react/macro';
type SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectSubFieldMenuProps =
{
@@ -29,6 +28,7 @@ export const SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectS
recordFilterId,
fieldMetadataItem,
}: SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectSubFieldMenuProps) => {
+ const { t } = useLingui();
const { getIcon } = useIcons();
const { applyAdvancedFilterCompositeSubField } =
useApplyAdvancedFilterCompositeSubField();
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFilterBuilderContent.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFilterBuilderContent.tsx
index f4914da06f8..ec872705b0a 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFilterBuilderContent.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFilterBuilderContent.tsx
@@ -1,7 +1,6 @@
/* @license Enterprise */
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconFilter, IconPlus } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
@@ -27,6 +26,7 @@ import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
align-items: start;
@@ -57,6 +57,7 @@ export const SettingsRolePermissionsObjectLevelRecordLevelPermissionFilterBuilde
roleId,
objectMetadataItem,
}: SettingsRolePermissionsObjectLevelRecordLevelPermissionFilterBuilderContentProps) => {
+ const { t } = useLingui();
const settingsDraftRole = useAtomFamilyStateValue(
settingsDraftRoleFamilyState,
roleId,
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionLogicalOperatorCell.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionLogicalOperatorCell.tsx
index 8ab56c41abc..b78e7af6692 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionLogicalOperatorCell.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionLogicalOperatorCell.tsx
@@ -1,7 +1,6 @@
/* @license Enterprise */
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { AdvancedFilterLogicalOperatorDropdown } from '@/object-record/advanced-filter/components/AdvancedFilterLogicalOperatorDropdown';
@@ -12,6 +11,7 @@ import { type RecordFilterGroup } from '@/object-record/record-filter-group/type
import { Select } from '@/ui/input/components/Select';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledText = styled.div`
align-items: center;
@@ -39,6 +39,7 @@ export const SettingsRolePermissionsObjectLevelRecordLevelPermissionLogicalOpera
index,
recordFilterGroup,
}: SettingsRolePermissionsObjectLevelRecordLevelPermissionLogicalOperatorCellProps) => {
+ const { t } = useLingui();
const { readonly } = useContext(AdvancedFilterContext);
const logicalOperatorOptions = ADVANCED_FILTER_LOGICAL_OPERATOR_OPTIONS.map(
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionMeValueSelect.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionMeValueSelect.tsx
index e3b3d8857b2..85ce930f4c1 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionMeValueSelect.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionMeValueSelect.tsx
@@ -1,8 +1,6 @@
/* @license Enterprise */
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useState } from 'react';
import { Dropdown } from 'twenty-ui/components/navigation';
@@ -31,6 +29,7 @@ import { RECORD_LEVEL_PERMISSION_PREDICATE_FIELD_TYPES } from '@/settings/roles/
import { getComparableWorkspaceMemberRelationFields } from '@/settings/roles/role-permissions/object-level-permissions/record-level-permissions/utils/getComparableWorkspaceMemberRelationFields';
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
+import { useLingui } from '@lingui/react/macro';
type SettingsRolePermissionsObjectLevelRecordLevelPermissionMeValueSelectProps =
{
@@ -43,6 +42,7 @@ export const SettingsRolePermissionsObjectLevelRecordLevelPermissionMeValueSelec
onSelect,
recordFilterId,
}: SettingsRolePermissionsObjectLevelRecordLevelPermissionMeValueSelectProps) => {
+ const { t } = useLingui();
const { getIcon } = useIcons();
const [searchInput, setSearchInput] = useState('');
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionValueInput.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionValueInput.tsx
index f62b3a12a8b..83d4037629e 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionValueInput.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionValueInput.tsx
@@ -1,7 +1,6 @@
/* @license Enterprise */
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useContext, useMemo } from 'react';
import { FieldMetadataType, CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -29,6 +28,7 @@ import { RecordLevelPermissionVariablePickerContext } from '@/settings/roles/rol
import { TooltipDelay } from '@/ui/layout/tooltip/constants/TooltipDelay';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
align-items: stretch;
@@ -101,6 +101,7 @@ export const SettingsRolePermissionsObjectLevelRecordLevelPermissionValueInput =
({
recordFilterId,
}: SettingsRolePermissionsObjectLevelRecordLevelPermissionValueInputProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const { objectMetadataItem } = useContext(AdvancedFilterContext);
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionVariablePicker.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionVariablePicker.tsx
index 8914aa7d014..7019aee5190 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionVariablePicker.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionVariablePicker.tsx
@@ -1,7 +1,6 @@
/* @license Enterprise */
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
@@ -14,6 +13,7 @@ import { RecordLevelPermissionVariablePickerContext } from '@/settings/roles/rol
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
+import { useLingui } from '@lingui/react/macro';
const StyledRecordLevelPermissionPickerContainer = styled.div<{
multiline?: boolean;
@@ -57,6 +57,7 @@ const StyledRecordLevelPermissionPickerContainer = styled.div<{
export const SettingsRolePermissionsObjectLevelRecordLevelPermissionVariablePicker: VariablePickerComponent =
({ instanceId, disabled, multiline }) => {
+ const { t } = useLingui();
const theme = useTheme();
const pickerContext = useContext(
RecordLevelPermissionVariablePickerContext,
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelSection.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelSection.tsx
index c72882cb066..2490ccc45bc 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelSection.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelSection.tsx
@@ -1,7 +1,6 @@
/* @license Enterprise */
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Section } from 'twenty-ui/components/layout';
import { IconArrowUp, IconLock } from 'twenty-ui/icon';
import { Card } from 'twenty-ui/primitives/surfaces';
@@ -16,6 +15,7 @@ import { Button } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
import { OrganizationAdornment } from '@/settings/enterprise/components/OrganizationAdornment';
+import { useLingui } from '@lingui/react/macro';
const StyledContent = styled.div`
padding-bottom: ${themeCssVariables.spacing[2]};
@@ -37,6 +37,7 @@ export const SettingsRolePermissionsObjectLevelRecordLevelSection = ({
roleId,
hasOrganizationPlan,
}: SettingsRolePermissionsObjectLevelRecordLevelSectionProps) => {
+ const { t } = useLingui();
const navigateSettings = useNavigateSettings();
const billing = useAtomStateValue(billingState);
const isBillingEnabled = billing?.isBillingEnabled ?? false;
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsSection.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsSection.tsx
index 436a6806568..4f1e616bdd2 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsSection.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsSection.tsx
@@ -5,9 +5,9 @@ import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDr
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Section } from 'twenty-ui/components/layout';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledTable = styled.div`
border-bottom: 1px solid ${themeCssVariables.border.color.light};
@@ -27,6 +27,7 @@ export const SettingsRolePermissionsObjectsSection = ({
roleId,
isEditable,
}: SettingsRolePermissionsObjectsSectionProps) => {
+ const { t } = useLingui();
const settingsDraftRole = useAtomFamilyStateValue(
settingsDraftRoleFamilyState,
roleId,
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableHeader.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableHeader.tsx
index 37a4154ff8a..ebd32591b4b 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableHeader.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableHeader.tsx
@@ -4,9 +4,9 @@ import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
import { TableRow } from '@/ui/layout/table/components/TableRow';
-import { t } from '@lingui/core/macro';
import { Checkbox } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SettingsRolePermissionsObjectsTableHeaderProps = {
roleId: string;
@@ -19,6 +19,7 @@ export const SettingsRolePermissionsObjectsTableHeader = ({
objectPermissionsConfig,
isEditable,
}: SettingsRolePermissionsObjectsTableHeaderProps) => {
+ const { t } = useLingui();
const settingsDraftRole = useAtomFamilyStateValue(
settingsDraftRoleFamilyState,
roleId,
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsSection.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsSection.tsx
index a5734881f89..d31fdae109d 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsSection.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsSection.tsx
@@ -7,12 +7,12 @@ import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDr
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Section } from 'twenty-ui/components/layout';
import { IconSettings } from 'twenty-ui/icon';
import { Collapsible } from 'twenty-ui/primitives/layout';
import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledTable = styled.div`
border-bottom: 1px solid ${themeCssVariables.border.color.light};
@@ -36,6 +36,7 @@ export const SettingsRolePermissionsSettingsSection = ({
roleId,
isEditable,
}: SettingsRolePermissionsSettingsSectionProps) => {
+ const { t } = useLingui();
const settingsDraftRole = useAtomFamilyStateValue(
settingsDraftRoleFamilyState,
roleId,
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsTableHeader.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsTableHeader.tsx
index 11bc13fb355..2ac5f45e993 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsTableHeader.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsTableHeader.tsx
@@ -1,6 +1,5 @@
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
-import { t } from '@lingui/core/macro';
import { Checkbox } from 'twenty-ui/primitives/input';
import { type SettingsRolePermissionsSettingPermission } from '@/settings/roles/role-permissions/permission-flags/types/SettingsRolePermissionsSettingPermission';
@@ -9,6 +8,7 @@ import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAto
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
import { v4 } from 'uuid';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SettingsRolePermissionsSettingsTableHeaderProps = {
roleId: string;
@@ -21,6 +21,7 @@ export const SettingsRolePermissionsSettingsTableHeader = ({
settingsPermissionsConfig,
isEditable,
}: SettingsRolePermissionsSettingsTableHeaderProps) => {
+ const { t } = useLingui();
const settingsDraftRole = useAtomFamilyStateValue(
settingsDraftRoleFamilyState,
roleId,
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsToolSection.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsToolSection.tsx
index 05fd2023e24..e76c2decd1b 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsToolSection.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsToolSection.tsx
@@ -7,13 +7,12 @@ import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDr
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
import { Section } from 'twenty-ui/components/layout';
import { IconTool } from 'twenty-ui/icon';
import { Collapsible } from 'twenty-ui/primitives/layout';
import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledTable = styled.div`
border-bottom: 1px solid ${themeCssVariables.border.color.light};
@@ -37,6 +36,7 @@ export const SettingsRolePermissionsToolSection = ({
roleId,
isEditable,
}: SettingsRolePermissionsToolSectionProps) => {
+ const { t } = useLingui();
const settingsDraftRole = useAtomFamilyStateValue(
settingsDraftRoleFamilyState,
roleId,
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
index bd65d18a38e..9a0ed648797 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
@@ -1,5 +1,4 @@
import { type SettingsRolePermissionsSettingPermission } from '@/settings/roles/role-permissions/permission-flags/types/SettingsRolePermissionsSettingPermission';
-import { t } from '@lingui/core/macro';
import { useMemo } from 'react';
import {
IconApi,
@@ -16,6 +15,7 @@ import {
IconUser,
} from 'twenty-ui/icon';
import { PermissionFlagType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type UseActionRolePermissionFlagConfigParams = {
assignmentCapabilities?: {
@@ -28,6 +28,7 @@ type UseActionRolePermissionFlagConfigParams = {
export const useActionRolePermissionFlagConfig = ({
assignmentCapabilities,
}: UseActionRolePermissionFlagConfigParams = {}): SettingsRolePermissionsSettingPermission[] => {
+ const { t } = useLingui();
const {
canBeAssignedToAgents = false,
canBeAssignedToUsers = false,
@@ -191,5 +192,6 @@ export const useActionRolePermissionFlagConfig = ({
canBeAssignedToAgents,
canBeAssignedToUsers,
canBeAssignedToApiKeys,
+ t,
]);
};
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/hooks/useSettingsRolePermissionFlagConfig.ts b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/hooks/useSettingsRolePermissionFlagConfig.ts
index 8d6fa41e50b..c410e75617c 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/hooks/useSettingsRolePermissionFlagConfig.ts
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/hooks/useSettingsRolePermissionFlagConfig.ts
@@ -1,5 +1,4 @@
import { type SettingsRolePermissionsSettingPermission } from '@/settings/roles/role-permissions/permission-flags/types/SettingsRolePermissionsSettingPermission';
-import { t } from '@lingui/core/macro';
import { useMemo } from 'react';
import {
IconApps,
@@ -17,6 +16,7 @@ import {
IconUsers,
} from 'twenty-ui/icon';
import { PermissionFlagType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type UseSettingsRolePermissionFlagConfigParams = {
assignmentCapabilities?: {
@@ -29,6 +29,7 @@ type UseSettingsRolePermissionFlagConfigParams = {
export const useSettingsRolePermissionFlagConfig = ({
assignmentCapabilities,
}: UseSettingsRolePermissionFlagConfigParams = {}): SettingsRolePermissionsSettingPermission[] => {
+ const { t } = useLingui();
const {
canBeAssignedToAgents = false,
canBeAssignedToUsers = false,
@@ -189,5 +190,6 @@ export const useSettingsRolePermissionFlagConfig = ({
canBeAssignedToAgents,
canBeAssignedToUsers,
canBeAssignedToApiKeys,
+ t,
]);
};
diff --git a/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleApplicability.tsx b/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleApplicability.tsx
index 74b93da8329..1453a41cd8d 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleApplicability.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleApplicability.tsx
@@ -1,10 +1,9 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
import { Section } from 'twenty-ui/components/layout';
import { IconKey, IconLego, IconUsers } from 'twenty-ui/icon';
import { Checkbox } from 'twenty-ui/primitives/input';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledCheckboxContainer = styled.div<{ disabled: boolean }>`
align-items: center;
@@ -47,6 +46,7 @@ export const SettingsRoleApplicability = ({
onApplicabilityChange,
isEditable,
}: SettingsRoleApplicabilityProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const options = [
diff --git a/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettings.tsx b/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettings.tsx
index 0e8d8cc15bc..310ed304cc9 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettings.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettings.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { MEMBER_ROLE_UNIVERSAL_IDENTIFIER } from 'twenty-shared/constants';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
@@ -17,6 +16,7 @@ import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
import { Section } from 'twenty-ui/components/layout';
import { Button } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledInputsContainer = styled.div`
display: flex;
@@ -41,6 +41,7 @@ export const SettingsRoleSettings = ({
isEditable,
isCreateMode,
}: SettingsRoleSettingsProps) => {
+ const { t } = useLingui();
const settingsDraftRole = useAtomFamilyStateValue(
settingsDraftRoleFamilyState,
roleId,
diff --git a/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModal.tsx b/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModal.tsx
index b8d51a83318..9f00df0229e 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModal.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModal.tsx
@@ -1,11 +1,11 @@
import { ROLE_SETTINGS_DELETE_ROLE_CONFIRMATION_MODAL_ID } from '@/settings/roles/role-settings/components/constants/RoleSettingsDeleteRoleConfirmationModalId';
import { SettingsRoleSettingsDeleteRoleConfirmationModalSubtitle } from '@/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModalSubtitle';
import { ConfirmationDialog } from '@/ui/layout/dialog/components/ConfirmationDialog';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { useMutation } from '@apollo/client/react';
import { DeleteOneRoleDocument } from '~/generated-metadata/graphql';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+import { useLingui } from '@lingui/react/macro';
type SettingsRoleSettingsDeleteRoleConfirmationModalProps = {
roleId: string;
@@ -14,6 +14,7 @@ type SettingsRoleSettingsDeleteRoleConfirmationModalProps = {
export const SettingsRoleSettingsDeleteRoleConfirmationModal = ({
roleId,
}: SettingsRoleSettingsDeleteRoleConfirmationModalProps) => {
+ const { t } = useLingui();
const [deleteRole] = useMutation(DeleteOneRoleDocument);
const navigateSettings = useNavigateSettings();
diff --git a/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModalSubtitle.tsx b/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModalSubtitle.tsx
index 2b07bd5fa41..e3d101e296a 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModalSubtitle.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModalSubtitle.tsx
@@ -1,6 +1,7 @@
import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDraftRoleFamilyState';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type SettingsRoleSettingsDeleteRoleConfirmationModalSubtitleProps = {
roleId: string;
@@ -9,6 +10,7 @@ type SettingsRoleSettingsDeleteRoleConfirmationModalSubtitleProps = {
export const SettingsRoleSettingsDeleteRoleConfirmationModalSubtitle = ({
roleId,
}: SettingsRoleSettingsDeleteRoleConfirmationModalSubtitleProps) => {
+ const { t } = useLingui();
const settingsDraftRole = useAtomFamilyStateValue(
settingsDraftRoleFamilyState,
roleId,
diff --git a/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx b/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx
index 612d81c94c6..f3d66035217 100644
--- a/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx
@@ -22,7 +22,6 @@ import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAto
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
import { useLoadCurrentUser } from '@/users/hooks/useLoadCurrentUser';
import { useRefreshAgentChatChannels } from '@/ai/hooks/useRefreshAgentChatChannels';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
@@ -31,6 +30,7 @@ import { IconLock, IconSettings, IconUserPlus } from 'twenty-ui/icon';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
import { getRoleDirtyFields } from '@/settings/roles/role/utils/getRoleDirtyFields';
+import { useLingui } from '@lingui/react/macro';
type SettingsRoleProps = {
roleId: string;
@@ -38,6 +38,7 @@ type SettingsRoleProps = {
};
export const SettingsRole = ({ roleId, isCreateMode }: SettingsRoleProps) => {
+ const { t } = useLingui();
const tabsComponentInstanceId = useWorkspaceSurfaceScopedComponentInstanceId(
SETTINGS_ROLE_DETAIL_TABS.COMPONENT_INSTANCE_ID + '-' + roleId,
);
diff --git a/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRoleLabelContainer.tsx b/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRoleLabelContainer.tsx
index 31cb8bab15a..ceb91b4b046 100644
--- a/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRoleLabelContainer.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRoleLabelContainer.tsx
@@ -2,7 +2,7 @@ import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDr
import { SettingsEditableTitle } from '@/settings/components/SettingsEditableTitle';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type SettingsRoleLabelContainerProps = {
roleId: string;
@@ -11,6 +11,7 @@ type SettingsRoleLabelContainerProps = {
export const SettingsRoleLabelContainer = ({
roleId,
}: SettingsRoleLabelContainerProps) => {
+ const { t } = useLingui();
const settingsDraftRole = useAtomFamilyStateValue(
settingsDraftRoleFamilyState,
roleId,
diff --git a/packages/twenty-front/src/modules/settings/security/components/TwoFactorAuthenticationSwitch.tsx b/packages/twenty-front/src/modules/settings/security/components/TwoFactorAuthenticationSwitch.tsx
index 97d2ab95389..0bb08d85a92 100644
--- a/packages/twenty-front/src/modules/settings/security/components/TwoFactorAuthenticationSwitch.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/TwoFactorAuthenticationSwitch.tsx
@@ -4,13 +4,14 @@ import { SettingsOptionCardContentSwitch } from '@/settings/components/SettingsO
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useToast } from 'twenty-ui/components/feedback';
import { IconLifebuoy } from 'twenty-ui/icon';
import { UpdateWorkspaceDocument } from '~/generated-metadata/graphql';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
export const TwoFactorAuthenticationSwitch = () => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const [currentWorkspace, setCurrentWorkspace] = useAtomState(
currentWorkspaceState,
diff --git a/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx
index bcece13730f..7218d20069f 100644
--- a/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx
@@ -3,7 +3,6 @@ import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent
import { approvedAccessDomainsState } from '@/settings/security/states/ApprovedAccessDomainsState';
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
import { LightIconButton } from 'twenty-ui/components/input';
@@ -13,6 +12,7 @@ import {
type ApprovedAccessDomain,
DeleteApprovedAccessDomainDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type SettingsSecurityApprovedAccessDomainRowDropdownMenuProps = {
approvedAccessDomain: Omit<ApprovedAccessDomain, '__typename'>;
@@ -21,6 +21,7 @@ type SettingsSecurityApprovedAccessDomainRowDropdownMenuProps = {
export const SettingsSecurityApprovedAccessDomainRowDropdownMenu = ({
approvedAccessDomain,
}: SettingsSecurityApprovedAccessDomainRowDropdownMenuProps) => {
+ const { t } = useLingui();
const dropdownId = `settings-approved-access-domain-row-${approvedAccessDomain.id}`;
const setApprovedAccessDomains = useSetAtomState(approvedAccessDomainsState);
diff --git a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoIdentitiesProvidersForm.tsx b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoIdentitiesProvidersForm.tsx
index f1f74798aa6..009335fd11f 100644
--- a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoIdentitiesProvidersForm.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoIdentitiesProvidersForm.tsx
@@ -6,14 +6,15 @@ import { SettingsSsoOidcForm } from '@/settings/security/components/sso/Settings
import { SettingsSsoSamlForm } from '@/settings/security/components/sso/SettingsSsoSamlForm';
import { type SettingSecurityNewSsoIdentityFormValues } from '@/settings/security/types/SsoIdentityProvider';
import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';
-import { t } from '@lingui/core/macro';
import { type ReactElement, useMemo } from 'react';
import { Controller, useFormContext } from 'react-hook-form';
import { Section } from 'twenty-ui/components/layout';
import { type IconComponent, IconKey } from 'twenty-ui/icon';
import { IdentityProviderType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const SettingsSsoIdentitiesProvidersForm = () => {
+ const { t } = useLingui();
const { control, watch } =
useFormContext<SettingSecurityNewSsoIdentityFormValues>();
diff --git a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoIdentitiesProvidersListCardWrapper.tsx b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoIdentitiesProvidersListCardWrapper.tsx
index 725bb547b2b..4038fffa70b 100644
--- a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoIdentitiesProvidersListCardWrapper.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoIdentitiesProvidersListCardWrapper.tsx
@@ -1,6 +1,4 @@
/* @license Enterprise */
-
-import { t } from '@lingui/core/macro';
import { SettingsListCard } from '@/settings/components/SettingsListCard';
import { SettingsSsoIdentityProviderRowRightContainer } from '@/settings/security/components/sso/SettingsSsoIdentityProviderRowRightContainer';
import { ssoIdentitiesProvidersState } from '@/settings/security/states/ssoIdentitiesProvidersState';
@@ -8,8 +6,10 @@ import { guessSsoIdentityProviderIconByUrl } from '@/settings/security/utils/gue
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { SettingsPath } from 'twenty-shared/types';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+import { useLingui } from '@lingui/react/macro';
export const SettingsSsoIdentitiesProvidersListCardWrapper = () => {
+ const { t } = useLingui();
const navigate = useNavigateSettings();
const ssoIdentitiesProviders = useAtomStateValue(ssoIdentitiesProvidersState);
diff --git a/packages/twenty-front/src/modules/settings/two-factor-authentication/components/TwoFactorAuthenticationRecoveryCodeConfirmationDialog.tsx b/packages/twenty-front/src/modules/settings/two-factor-authentication/components/TwoFactorAuthenticationRecoveryCodeConfirmationDialog.tsx
index d69a749ed6e..f0d29ecf7cf 100644
--- a/packages/twenty-front/src/modules/settings/two-factor-authentication/components/TwoFactorAuthenticationRecoveryCodeConfirmationDialog.tsx
+++ b/packages/twenty-front/src/modules/settings/two-factor-authentication/components/TwoFactorAuthenticationRecoveryCodeConfirmationDialog.tsx
@@ -2,10 +2,10 @@ import { TwoFactorAuthenticationVerificationCodeDash } from '@/settings/two-fact
import { TwoFactorAuthenticationVerificationCodeSlot } from '@/settings/two-factor-authentication/components/TwoFactorAuthenticationVerificationCodeSlot';
import { ConfirmationDialog } from '@/ui/layout/dialog/components/ConfirmationDialog';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { OTPInput } from 'input-otp';
import { useState } from 'react';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const OTP_LENGTH = 6;
@@ -32,6 +32,7 @@ export const TwoFactorAuthenticationRecoveryCodeConfirmationDialog = ({
memberName,
onConfirm,
}: TwoFactorAuthenticationRecoveryCodeConfirmationDialogProps) => {
+ const { t } = useLingui();
const [otp, setOtp] = useState('');
return (
diff --git a/packages/twenty-front/src/modules/settings/usage/components/SettingsUsageAnalyticsSection.tsx b/packages/twenty-front/src/modules/settings/usage/components/SettingsUsageAnalyticsSection.tsx
index 5cff09c70ce..b47d90528e3 100644
--- a/packages/twenty-front/src/modules/settings/usage/components/SettingsUsageAnalyticsSection.tsx
+++ b/packages/twenty-front/src/modules/settings/usage/components/SettingsUsageAnalyticsSection.tsx
@@ -8,14 +8,15 @@ import { UsageDailyChartSection } from '@/settings/usage/components/UsageDailyCh
import { UsageSectionSkeleton } from '@/settings/usage/components/UsageSectionSkeleton';
import { useUsageAnalyticsData } from '@/settings/usage/hooks/useUsageAnalyticsData';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
import { IconSparkles } from 'twenty-ui/icon';
import { SETTINGS_AI_TABS } from '@/settings/ai/constants/SettingsAiTabs';
+import { useLingui } from '@lingui/react/macro';
export const SettingsUsageAnalyticsSection = () => {
+ const { t } = useLingui();
const isClickHouseConfigured = useAtomStateValue(isClickHouseConfiguredState);
const { analytics, isInitialLoading } = useUsageAnalyticsData({
diff --git a/packages/twenty-front/src/modules/settings/usage/components/UsageByUserTableSection.tsx b/packages/twenty-front/src/modules/settings/usage/components/UsageByUserTableSection.tsx
index f112ddcf54b..379227e5fc0 100644
--- a/packages/twenty-front/src/modules/settings/usage/components/UsageByUserTableSection.tsx
+++ b/packages/twenty-front/src/modules/settings/usage/components/UsageByUserTableSection.tsx
@@ -7,7 +7,6 @@ import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { SearchInput } from 'twenty-ui/components/input';
import { Section } from 'twenty-ui/components/layout';
@@ -16,6 +15,7 @@ import { Avatar } from 'twenty-ui/primitives/data-display';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { type UsageOperationType } from '~/generated-metadata/graphql';
import { normalizeSearchText } from 'twenty-ui/utilities';
+import { useLingui } from '@lingui/react/macro';
const StyledSearchInputContainer = styled.div`
padding-bottom: ${themeCssVariables.spacing[2]};
@@ -44,6 +44,7 @@ export const UsageByUserTableSection = ({
getDetailPath,
showAvatar = false,
}: UsageByUserTableSectionProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const { formatUsageValue } = useUsageValueFormatter();
const [searchTerm, setSearchTerm] = useState('');
diff --git a/packages/twenty-front/src/modules/settings/workspace-member/components/WorkspaceMemberPictureUploader.tsx b/packages/twenty-front/src/modules/settings/workspace-member/components/WorkspaceMemberPictureUploader.tsx
index 725706b9809..bbb2194b8ad 100644
--- a/packages/twenty-front/src/modules/settings/workspace-member/components/WorkspaceMemberPictureUploader.tsx
+++ b/packages/twenty-front/src/modules/settings/workspace-member/components/WorkspaceMemberPictureUploader.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
@@ -12,6 +11,7 @@ import { FileFolder } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
import { REACT_APP_SERVER_BASE_URL } from '~/config';
+import { useLingui } from '@lingui/react/macro';
type WorkspaceMemberPictureUploaderProps = {
workspaceMemberId: string;
@@ -26,6 +26,7 @@ export const WorkspaceMemberPictureUploader = ({
onAvatarUpdated,
disabled = false,
}: WorkspaceMemberPictureUploaderProps) => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const [isUploading, setIsUploading] = useState(false);
const [isRemoving, setIsRemoving] = useState(false);
diff --git a/packages/twenty-front/src/modules/settings/workspace/components/ClickTrackingSwitch.tsx b/packages/twenty-front/src/modules/settings/workspace/components/ClickTrackingSwitch.tsx
index 2dc60b2a498..f3f2c5b50fb 100644
--- a/packages/twenty-front/src/modules/settings/workspace/components/ClickTrackingSwitch.tsx
+++ b/packages/twenty-front/src/modules/settings/workspace/components/ClickTrackingSwitch.tsx
@@ -3,17 +3,18 @@ import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsF
import { SettingsOptionCardContentSwitch } from '@/settings/components/SettingsOptions/SettingsOptionCardContentSwitch';
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { IconClick } from 'twenty-ui/icon';
import { useToast } from 'twenty-ui/components/feedback';
import { UpdateWorkspaceDocument } from '~/generated-metadata/graphql';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
type ClickTrackingSwitchProps = {
divider?: boolean;
};
export const ClickTrackingSwitch = ({ divider }: ClickTrackingSwitchProps) => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const [currentWorkspace, setCurrentWorkspace] = useAtomState(
currentWorkspaceState,
diff --git a/packages/twenty-front/src/modules/settings/workspace/components/ImpersonationSwitch.tsx b/packages/twenty-front/src/modules/settings/workspace/components/ImpersonationSwitch.tsx
index c26e11731cf..ee8a9400c2e 100644
--- a/packages/twenty-front/src/modules/settings/workspace/components/ImpersonationSwitch.tsx
+++ b/packages/twenty-front/src/modules/settings/workspace/components/ImpersonationSwitch.tsx
@@ -4,15 +4,16 @@ import { SettingsOptionCardContentSwitch } from '@/settings/components/SettingsO
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { IconLifebuoy } from 'twenty-ui/icon';
import { Card } from 'twenty-ui/primitives/surfaces';
import { UpdateWorkspaceDocument } from '~/generated-metadata/graphql';
import { useToast } from 'twenty-ui/components/feedback';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
export const ImpersonationSwitch = () => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const [currentWorkspace, setCurrentWorkspace] = useAtomState(
diff --git a/packages/twenty-front/src/modules/settings/workspace/components/OpenTrackingSwitch.tsx b/packages/twenty-front/src/modules/settings/workspace/components/OpenTrackingSwitch.tsx
index aafcf7e9e75..717d599e50e 100644
--- a/packages/twenty-front/src/modules/settings/workspace/components/OpenTrackingSwitch.tsx
+++ b/packages/twenty-front/src/modules/settings/workspace/components/OpenTrackingSwitch.tsx
@@ -3,17 +3,18 @@ import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsF
import { SettingsOptionCardContentSwitch } from '@/settings/components/SettingsOptions/SettingsOptionCardContentSwitch';
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { IconEye } from 'twenty-ui/icon';
import { useToast } from 'twenty-ui/components';
import { UpdateWorkspaceDocument } from '~/generated-metadata/graphql';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
type OpenTrackingSwitchProps = {
divider?: boolean;
};
export const OpenTrackingSwitch = ({ divider }: OpenTrackingSwitchProps) => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const [currentWorkspace, setCurrentWorkspace] = useAtomState(
currentWorkspaceState,
diff --git a/packages/twenty-front/src/modules/settings/workspace/components/WorkspaceLogoUploader.tsx b/packages/twenty-front/src/modules/settings/workspace/components/WorkspaceLogoUploader.tsx
index b687b509ff7..a4140a32aec 100644
--- a/packages/twenty-front/src/modules/settings/workspace/components/WorkspaceLogoUploader.tsx
+++ b/packages/twenty-front/src/modules/settings/workspace/components/WorkspaceLogoUploader.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
@@ -9,8 +8,10 @@ import { useMutation } from '@apollo/client/react';
import { useToast } from 'twenty-ui/components/feedback';
import { UpdateWorkspaceDocument } from '~/generated-metadata/graphql';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
export const WorkspaceLogoUploader = () => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const { uploadWorkspaceLogo } = useUploadWorkspaceLogo();
const [updateWorkspace] = useMutation(UpdateWorkspaceDocument);
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelAskAiInfo.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelAskAiInfo.tsx
index a0130b15cd7..411c844dec9 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelAskAiInfo.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelAskAiInfo.tsx
@@ -6,9 +6,9 @@ import { HeaderIdentifier } from '@/ui/layout/page/components/HeaderIdentifier';
import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilySelectorValue';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
align-items: center;
@@ -18,6 +18,7 @@ const StyledContainer = styled.div`
`;
export const SidePanelAskAiInfo = () => {
+ const { t } = useLingui();
const currentAiChatThread = useAtomStateValue(currentAiChatThreadState);
const isOnNewAiChatSlot = useIsOnNewAiChatSlot();
const currentAiChatThreadTitle = useAtomFamilySelectorValue(
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelBackButton.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelBackButton.tsx
index 735a05f31a8..c25aae6447b 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelBackButton.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelBackButton.tsx
@@ -5,14 +5,15 @@ import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { useOpenDropdown } from '@/ui/layout/dropdown/hooks/useOpenDropdown';
-import { t } from '@lingui/core/macro';
import { Children, useRef, type MouseEvent } from 'react';
import { isNonEmptyArray } from 'twenty-shared/utils';
import { IconButton } from 'twenty-ui/components/input';
import { Dropdown } from 'twenty-ui/components/navigation';
import { IconChevronLeft } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const SidePanelBackButton = () => {
+ const { t } = useLingui();
const { goBackFromSidePanel } = useSidePanelHistory();
const { contextChips } = useSidePanelContextChips();
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelList.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelList.tsx
index e71f2e8d716..13f1c4beea9 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelList.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelList.tsx
@@ -9,8 +9,8 @@ import { SelectableList } from '@/ui/layout/selectable-list/components/Selectabl
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SidePanelListProps = {
selectableItemIds: string[];
@@ -55,6 +55,7 @@ export const SidePanelList = ({
noResults = false,
noResultsText,
}: SidePanelListProps) => {
+ const { t } = useLingui();
const setHasUserSelectedSidePanelListItem = useSetAtomState(
hasUserSelectedSidePanelListItemState,
);
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelMultipleRecordsInfo.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelMultipleRecordsInfo.tsx
index d40b8f4adb2..dae22c281e3 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelMultipleRecordsInfo.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelMultipleRecordsInfo.tsx
@@ -1,9 +1,9 @@
import { HeaderIdentifier } from '@/ui/layout/page/components/HeaderIdentifier';
import { useFindManyRecordsSelectedInContextStore } from '@/context-store/hooks/useFindManyRecordsSelectedInContextStore';
import { useNumberFormat } from '@/localization/hooks/useNumberFormat';
-import { t } from '@lingui/core/macro';
import { IconPencil } from 'twenty-ui/icon';
import { useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SidePanelMultipleRecordsInfoProps = {
sidePanelPageInstanceId: string;
@@ -12,6 +12,7 @@ type SidePanelMultipleRecordsInfoProps = {
export const SidePanelMultipleRecordsInfo = ({
sidePanelPageInstanceId,
}: SidePanelMultipleRecordsInfoProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const { formatNumber } = useNumberFormat();
const { totalCount } = useFindManyRecordsSelectedInContextStore({
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelPageLayoutInfo.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelPageLayoutInfo.tsx
index d317d01c516..c86de8cc0b0 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelPageLayoutInfo.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelPageLayoutInfo.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { useUpdatePageLayoutTab } from '@/page-layout/hooks/useUpdatePageLayoutTab';
import { useUpdatePageLayoutWidget } from '@/page-layout/hooks/useUpdatePageLayoutWidget';
import { pageLayoutDraftComponentState } from '@/page-layout/states/pageLayoutDraftComponentState';
@@ -22,6 +21,7 @@ import { isDefined } from 'twenty-shared/utils';
import { useIcons } from 'twenty-ui/icon/provider';
import { useTheme } from 'twenty-ui/theme';
import { HeaderIdentifier } from '@/ui/layout/page/components/HeaderIdentifier';
+import { useLingui } from '@lingui/react/macro';
const StyledClickableIconWrapper = styled.div`
cursor: pointer;
@@ -39,6 +39,7 @@ export const SidePanelPageLayoutInfo = ({
}: {
pageLayoutId: string;
}) => {
+ const { t } = useLingui();
const theme = useTheme();
const { getIcon } = useIcons();
const sidePanelPageInfo = useAtomStateValue(sidePanelPageInfoSelector);
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelRecordFiltersDeletedFieldsWarning.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelRecordFiltersDeletedFieldsWarning.tsx
index a3f5e67660c..1102ee89611 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelRecordFiltersDeletedFieldsWarning.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelRecordFiltersDeletedFieldsWarning.tsx
@@ -2,8 +2,8 @@ import { currentRecordFiltersComponentState } from '@/object-record/record-filte
import { unresolvedRecordFiltersComponentState } from '@/object-record/record-filter/states/unresolvedRecordFiltersComponentState';
import { SidePanelInformationBanner } from '@/side-panel/components/SidePanelInformationBanner/SidePanelInformationBanner';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
type SidePanelRecordFiltersDeletedFieldsWarningProps = {
validFieldMetadataIds?: Set<string>;
@@ -12,6 +12,7 @@ type SidePanelRecordFiltersDeletedFieldsWarningProps = {
export const SidePanelRecordFiltersDeletedFieldsWarning = ({
validFieldMetadataIds,
}: SidePanelRecordFiltersDeletedFieldsWarningProps) => {
+ const { t } = useLingui();
const currentRecordFilters = useAtomComponentStateValue(
currentRecordFiltersComponentState,
);
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelSendCampaignInfo.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelSendCampaignInfo.tsx
index 7d481cea081..56990b64eb0 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelSendCampaignInfo.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelSendCampaignInfo.tsx
@@ -1,4 +1,4 @@
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconSend } from 'twenty-ui/icon';
import { useTheme } from 'twenty-ui/theme';
@@ -8,6 +8,7 @@ import { useNumberFormat } from '@/localization/hooks/useNumberFormat';
import { sendCampaignCampaignIdComponentState } from '@/side-panel/pages/send-campaign/states/sendCampaignCampaignIdComponentState';
import { HeaderIdentifier } from '@/ui/layout/page/components/HeaderIdentifier';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
+import { useLingui } from '@lingui/react/macro';
type SidePanelSendCampaignInfoProps = {
sidePanelPageInstanceId: string;
@@ -16,6 +17,7 @@ type SidePanelSendCampaignInfoProps = {
export const SidePanelSendCampaignInfo = ({
sidePanelPageInstanceId,
}: SidePanelSendCampaignInfoProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const { formatNumber } = useNumberFormat();
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelToggleButton.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelToggleButton.tsx
index 7c373036eab..d8b7b42fa48 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelToggleButton.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelToggleButton.tsx
@@ -10,13 +10,13 @@ import { PAGE_HEADER_SIDE_PANEL_BUTTON_CLICK_OUTSIDE_ID } from '@/ui/layout/page
import { TooltipDelay } from '@/ui/layout/tooltip/constants/TooltipDelay';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { SidePanelPages } from 'twenty-shared/types';
import { IconDotsVertical } from 'twenty-ui/icon';
import { IconButton } from 'twenty-ui/components/input';
import { Tooltip } from 'twenty-ui/primitives/surfaces';
import { useIsMobile } from 'twenty-ui/utilities';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledButtonWrapper = styled.div<{ alignToTop: boolean }>`
align-items: ${({ alignToTop }) => (alignToTop ? 'center' : 'initial')};
@@ -32,6 +32,7 @@ const StyledButtonWrapper = styled.div<{ alignToTop: boolean }>`
`;
export const SidePanelToggleButton = () => {
+ const { t } = useLingui();
const { openSidePanelMenu } = useSidePanelMenu();
const isSidePanelOpened = useAtomStateValue(isSidePanelOpenedState);
const sidePanelNavigationStack = useAtomStateValue(
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBarRightCornerIcon.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBarRightCornerIcon.tsx
index ccc2c283237..586f0094637 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBarRightCornerIcon.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBarRightCornerIcon.tsx
@@ -5,18 +5,19 @@ import { sidePanelSearchObjectFilterState } from '@/side-panel/states/sidePanelS
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { SidePanelPages } from 'twenty-shared/types';
import { IconEdit } from 'twenty-ui/icon';
import { IconButton } from 'twenty-ui/components/input';
import { useIsMobile } from 'twenty-ui/utilities';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledIconButtonContainer = styled.div`
color: ${themeCssVariables.font.color.secondary};
`;
export const SidePanelTopBarRightCornerIcon = () => {
+ const { t } = useLingui();
const isMobile = useIsMobile();
const sidePanelPage = useAtomStateValue(sidePanelPageInfoSelector).page;
const { switchToNewChat } = useSwitchToNewAiChat();
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelWorkflowStepInfo.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelWorkflowStepInfo.tsx
index 7ac51bb346c..950e546b645 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelWorkflowStepInfo.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelWorkflowStepInfo.tsx
@@ -20,7 +20,6 @@ import { getActionIcon } from '@/workflow/workflow-steps/workflow-actions/utils/
import { getActionIconColorOrThrow } from '@/workflow/workflow-steps/workflow-actions/utils/getActionIconColorOrThrow';
import { getTriggerIcon } from '@/workflow/workflow-trigger/utils/getTriggerIcon';
import { getTriggerIconColor } from '@/workflow/workflow-trigger/utils/getTriggerIconColor';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { SidePanelPages } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -28,12 +27,14 @@ import { TRIGGER_STEP_ID } from 'twenty-shared/workflow';
import { useIcons } from 'twenty-ui/icon/provider';
import { HeaderIdentifier } from '@/ui/layout/page/components/HeaderIdentifier';
import { useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
export const SidePanelWorkflowStepInfo = ({
sidePanelPageInstanceId,
}: {
sidePanelPageInstanceId: string;
}) => {
+ const { t } = useLingui();
const theme = useTheme();
const { getIcon } = useIcons();
diff --git a/packages/twenty-front/src/modules/side-panel/components/hooks/usePageLayoutHeaderInfo.ts b/packages/twenty-front/src/modules/side-panel/components/hooks/usePageLayoutHeaderInfo.ts
index 0a4b7f69cc4..26d6029c0d6 100644
--- a/packages/twenty-front/src/modules/side-panel/components/hooks/usePageLayoutHeaderInfo.ts
+++ b/packages/twenty-front/src/modules/side-panel/components/hooks/usePageLayoutHeaderInfo.ts
@@ -4,7 +4,6 @@ import { isViewportFillingWidget } from '@/page-layout/widgets/utils/isViewportF
import { GRAPH_TYPE_INFORMATION } from '@/side-panel/pages/page-layout/constants/GraphTypeInformation';
import { getCurrentGraphTypeFromConfig } from '@/side-panel/pages/page-layout/utils/getCurrentGraphTypeFromConfig';
import { isWidgetConfigurationOfTypeGraph } from '@/side-panel/pages/page-layout/utils/isWidgetConfigurationOfTypeGraph';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { SidePanelPages } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -19,6 +18,7 @@ import {
} from 'twenty-ui/icon';
import { useIcons } from 'twenty-ui/icon/provider';
import { useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type PageLayoutHeaderInfo = {
headerIcon: IconComponent | undefined;
@@ -79,6 +79,7 @@ export const usePageLayoutHeaderInfo = ({
openTabId,
editedTitle,
}: UsePageLayoutHeaderInfoParams): PageLayoutHeaderInfo | null => {
+ const { t } = useLingui();
const theme = useTheme();
const { getIcon } = useIcons();
const iconColor = theme.font.color.tertiary;
diff --git a/packages/twenty-front/src/modules/side-panel/hooks/useOpenRecordsSearchPageInSidePanel.ts b/packages/twenty-front/src/modules/side-panel/hooks/useOpenRecordsSearchPageInSidePanel.ts
index eecf77a194a..54062f3b6d2 100644
--- a/packages/twenty-front/src/modules/side-panel/hooks/useOpenRecordsSearchPageInSidePanel.ts
+++ b/packages/twenty-front/src/modules/side-panel/hooks/useOpenRecordsSearchPageInSidePanel.ts
@@ -1,12 +1,13 @@
import { useSidePanelMenu } from '@/side-panel/hooks/useSidePanelMenu';
import { isSidePanelOpenedState } from '@/side-panel/states/isSidePanelOpenedState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { SidePanelPages } from 'twenty-shared/types';
import { IconSearch } from 'twenty-ui/icon';
import { v4 } from 'uuid';
+import { useLingui } from '@lingui/react/macro';
export const useOpenRecordsSearchPageInSidePanel = () => {
+ const { t } = useLingui();
const { navigateSidePanelMenu } = useSidePanelMenu();
const isSidePanelOpened = useAtomStateValue(isSidePanelOpenedState);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/add-to-message-list/hooks/useAddPeopleToMessageList.ts b/packages/twenty-front/src/modules/side-panel/pages/add-to-message-list/hooks/useAddPeopleToMessageList.ts
index b106457860e..44ff2cd9e49 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/add-to-message-list/hooks/useAddPeopleToMessageList.ts
+++ b/packages/twenty-front/src/modules/side-panel/pages/add-to-message-list/hooks/useAddPeopleToMessageList.ts
@@ -2,7 +2,6 @@ import { useTrackedQueueJob } from '@/queue-job/hooks/useTrackedQueueJob';
import { type TrackedJobStatus } from '@/queue-job/types/TrackedJobStatus';
import { CombinedGraphQLErrors } from '@apollo/client/errors';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useCallback } from 'react';
import { type RecordGqlOperationFilter } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -12,6 +11,7 @@ import {
TriggerAddPeopleToMessageListJobDocument,
} from '~/generated-metadata/graphql';
import { getErrorMessageFromApolloError } from '~/utils/get-error-message-from-apollo-error.util';
+import { useLingui } from '@lingui/react/macro';
type UseAddPeopleToMessageListArgs = {
messageListId: string | null;
@@ -24,6 +24,7 @@ export const useAddPeopleToMessageList = ({
personFilter,
onCompleted,
}: UseAddPeopleToMessageListArgs) => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const [triggerAddPeopleToMessageListJob, { loading: isTriggeringAdd }] =
useMutation(TriggerAddPeopleToMessageListJobDocument);
@@ -44,7 +45,7 @@ export const useAddPeopleToMessageList = ({
});
onCompleted();
},
- [enqueueToast, onCompleted],
+ [enqueueToast, onCompleted, t],
);
const { activeJobId, trackJob } = useTrackedQueueJob({
diff --git a/packages/twenty-front/src/modules/side-panel/pages/compose-calendar-event/components/SidePanelComposeCalendarEventPage.tsx b/packages/twenty-front/src/modules/side-panel/pages/compose-calendar-event/components/SidePanelComposeCalendarEventPage.tsx
index 14e85bb84f4..89bc1ca4f79 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/compose-calendar-event/components/SidePanelComposeCalendarEventPage.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/compose-calendar-event/components/SidePanelComposeCalendarEventPage.tsx
@@ -10,7 +10,6 @@ import { SidePanelFooter } from '@/ui/layout/side-panel/components/SidePanelFoot
import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { ConnectedAccountProvider, SettingsPath } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
@@ -19,6 +18,7 @@ import { IconCalendarEvent, IconTrash } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { PermissionFlagType } from '~/generated-metadata/graphql';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: flex;
@@ -27,6 +27,7 @@ const StyledContainer = styled.div`
`;
export const SidePanelComposeCalendarEventPage = () => {
+ const { t } = useLingui();
const composeCalendarEventInitialValues = useAtomComponentStateValue(
composeCalendarEventInitialValuesComponentState,
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/compose-email/components/SidePanelComposeEmailPage.tsx b/packages/twenty-front/src/modules/side-panel/pages/compose-email/components/SidePanelComposeEmailPage.tsx
index 346ae3be1bd..19061bf4e89 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/compose-email/components/SidePanelComposeEmailPage.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/compose-email/components/SidePanelComposeEmailPage.tsx
@@ -13,12 +13,12 @@ import { SidePanelFooter } from '@/ui/layout/side-panel/components/SidePanelFoot
import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { IconPaperclip, IconSend, IconTrash } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { IconButton } from 'twenty-ui/components/input';
import { useAttachEmailFiles } from '@/activities/emails/hooks/useAttachEmailFiles';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: flex;
@@ -34,6 +34,7 @@ const StyledContent = styled.div`
`;
export const SidePanelComposeEmailPage = () => {
+ const { t } = useLingui();
const composeEmailConnectedAccountId = useAtomComponentStateValue(
composeEmailConnectedAccountIdComponentState,
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/create-related-record/components/SidePanelCreateRelatedRecordPage.tsx b/packages/twenty-front/src/modules/side-panel/pages/create-related-record/components/SidePanelCreateRelatedRecordPage.tsx
index 0e77ed31839..3259173f1d2 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/create-related-record/components/SidePanelCreateRelatedRecordPage.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/create-related-record/components/SidePanelCreateRelatedRecordPage.tsx
@@ -8,8 +8,8 @@ import { useSidePanelMenu } from '@/side-panel/hooks/useSidePanelMenu';
import { createRelatedRecordTargetComponentState } from '@/side-panel/pages/create-related-record/states/createRelatedRecordTargetComponentState';
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
type SidePanelCreateRelatedRecordActionListProps = {
actionBindings: RelatedRecordActionBinding[];
@@ -18,6 +18,7 @@ type SidePanelCreateRelatedRecordActionListProps = {
export const SidePanelCreateRelatedRecordActionList = ({
actionBindings,
}: SidePanelCreateRelatedRecordActionListProps) => {
+ const { t } = useLingui();
const visibleActionBindings = actionBindings.filter(
({ action }) => action.isVisible,
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartFiltersSettings.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartFiltersSettings.tsx
index d920b9c145f..f91b99ddc07 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartFiltersSettings.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartFiltersSettings.tsx
@@ -17,10 +17,10 @@ import { mapRecordFiltersToPersistedRecordFilters } from '@/object-record/record
import { InputLabel } from '@/ui/input/components/internal/InputLabel/InputLabel';
import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useStore } from 'jotai';
import { useMemo } from 'react';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledChartFiltersPageContainer = styled.div`
display: flex;
@@ -40,6 +40,7 @@ export const ChartFiltersSettings = ({
objectMetadataItem,
widget,
}: ChartFiltersSettingsProps) => {
+ const { t } = useLingui();
const { instanceId } = getChartFiltersSettingsInstanceId({
widgetId: widget.id,
objectMetadataItemId: objectMetadataItem.id,
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartLimitInfoBanner.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartLimitInfoBanner.tsx
index 664c1d6c3f1..a654b063f46 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartLimitInfoBanner.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartLimitInfoBanner.tsx
@@ -1,7 +1,7 @@
import { SidePanelInformationBanner } from '@/side-panel/components/SidePanelInformationBanner/SidePanelInformationBanner';
import { getChartLimitMessage } from '@/side-panel/pages/page-layout/utils/getChartLimitMessage';
-import { t } from '@lingui/core/macro';
import { type WidgetConfigurationType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type ChartLimitInfoBannerProps = {
widgetConfigurationType: WidgetConfigurationType;
@@ -16,6 +16,7 @@ export const ChartLimitInfoBanner = ({
isPrimaryAxisDate,
primaryAxisDateGranularity,
}: ChartLimitInfoBannerProps) => {
+ const { t } = useLingui();
return (
<SidePanelInformationBanner
message={getChartLimitMessage({
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartSettings.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartSettings.tsx
index 93897a54971..701d0415582 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartSettings.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartSettings.tsx
@@ -16,7 +16,6 @@ import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadat
import { hasWidgetTooManyGroupsComponentState } from '@/page-layout/widgets/graph/states/hasWidgetTooManyGroupsComponentState';
import { useAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isFieldMetadataDateKind } from 'twenty-shared/utils';
import { GraphType } from '@/side-panel/pages/page-layout/types/GraphType';
@@ -24,6 +23,7 @@ import { assertChartWidgetOrThrow } from '@/side-panel/pages/page-layout/utils/a
import { getCurrentGraphTypeFromConfig } from '@/side-panel/pages/page-layout/utils/getCurrentGraphTypeFromConfig';
import { isWidgetConfigurationOfType } from '@/side-panel/pages/page-layout/utils/isWidgetConfigurationOfType';
import { type PageLayoutWidget } from '@/page-layout/types/PageLayoutWidget';
+import { useLingui } from '@lingui/react/macro';
const StyledSidePanelContainer = styled.div`
display: flex;
@@ -33,6 +33,7 @@ const StyledSidePanelContainer = styled.div`
`;
export const ChartSettings = ({ widget }: { widget: PageLayoutWidget }) => {
+ const { t } = useLingui();
const { updateSidePanelPageInfo } = useUpdateSidePanelPageInfo();
const { pageLayoutId } = usePageLayoutSidePanelTarget();
const { updateCurrentWidgetConfig } =
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartTypeSelectionSection.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartTypeSelectionSection.tsx
index a7a6c2a11f3..58ef7905d04 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartTypeSelectionSection.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/ChartTypeSelectionSection.tsx
@@ -2,10 +2,10 @@ import { GRAPH_TYPE_INFORMATION } from '@/side-panel/pages/page-layout/constants
import { styled } from '@linaria/react';
import { GraphType } from '@/side-panel/pages/page-layout/types/GraphType';
-import { t } from '@lingui/core/macro';
import { Button } from 'twenty-ui/primitives/input';
import { Tooltip } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables, useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const GRAPH_TYPE_OPTIONS = [
GraphType.VERTICAL_BAR,
@@ -54,6 +54,7 @@ export const ChartTypeSelectionSection = ({
currentGraphType,
setCurrentGraphType,
}: ChartTypeSelectionSectionProps) => {
+ const { t } = useLingui();
const theme = useTheme();
return (
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/SidePanelPageLayoutDashboardWidgetTypeSelect.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/SidePanelPageLayoutDashboardWidgetTypeSelect.tsx
index 354e2ead6d1..3691092d138 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/SidePanelPageLayoutDashboardWidgetTypeSelect.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/SidePanelPageLayoutDashboardWidgetTypeSelect.tsx
@@ -21,7 +21,6 @@ import { SelectableListItem } from '@/ui/layout/selectable-list/components/Selec
import { useAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { CoreObjectNameSingular, SidePanelPages } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import {
@@ -37,8 +36,10 @@ import {
WidgetConfigurationType,
WidgetType,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const SidePanelPageLayoutDashboardWidgetTypeSelect = () => {
+ const { t } = useLingui();
const { pageLayoutId, targetRecordIdentifier } =
usePageLayoutSidePanelTarget();
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/SidePanelPageLayoutRecordPageWidgetTypeSelect.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/SidePanelPageLayoutRecordPageWidgetTypeSelect.tsx
index 9e869cde2e1..c58445b263b 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/SidePanelPageLayoutRecordPageWidgetTypeSelect.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/SidePanelPageLayoutRecordPageWidgetTypeSelect.tsx
@@ -29,7 +29,6 @@ import { useAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useAtomC
import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useStore } from 'jotai';
import { useCallback } from 'react';
import { SidePanelPages } from 'twenty-shared/types';
@@ -48,8 +47,10 @@ import {
WidgetConfigurationType,
WidgetType,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const SidePanelPageLayoutRecordPageWidgetTypeSelect = () => {
+ const { t } = useLingui();
const {
pageLayoutId,
targetRecordIdentifier: { targetObjectNameSingular },
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/chart-settings/ChartSettingItem.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/chart-settings/ChartSettingItem.tsx
index d5df659fe62..7706823326d 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/chart-settings/ChartSettingItem.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/chart-settings/ChartSettingItem.tsx
@@ -20,9 +20,9 @@ import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { useOpenDropdown } from '@/ui/layout/dropdown/hooks/useOpenDropdown';
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
import { useSelectableList } from '@/ui/layout/selectable-list/hooks/useSelectableList';
-import { t } from '@lingui/core/macro';
import { isString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
const CHART_SETTINGS_DROPDOWN_SIDE_OFFSET = 4;
@@ -37,6 +37,7 @@ export const ChartSettingItem = ({
objectMetadataId,
configuration,
}: ChartSettingItemProps) => {
+ const { t } = useLingui();
const { pageLayoutId } = usePageLayoutSidePanelTarget();
const { openDropdown } = useOpenDropdown();
const { setSelectedItemId } = useSelectableList(
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dashboard/SidePanelDashboardIframeSettings.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dashboard/SidePanelDashboardIframeSettings.tsx
index c4e64948f72..d2d002c6ea4 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dashboard/SidePanelDashboardIframeSettings.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dashboard/SidePanelDashboardIframeSettings.tsx
@@ -7,11 +7,11 @@ import { WidgetSettingsFooter } from '@/side-panel/pages/page-layout/components/
import { usePageLayoutSidePanelTarget } from '@/side-panel/pages/page-layout/hooks/usePageLayoutSidePanelTarget';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString, isString } from '@sniptt/guards';
import { useState } from 'react';
import { isDefined, isValidUrl } from 'twenty-shared/utils';
import { WidgetConfigurationType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: flex;
@@ -27,6 +27,7 @@ const StyledSidePanelContainer = styled.div`
`;
export const SidePanelDashboardIframeSettings = () => {
+ const { t } = useLingui();
const { pageLayoutId } = usePageLayoutSidePanelTarget();
const { widgetInEditMode } = useWidgetInEditMode(pageLayoutId);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAggregateOperationSelectionDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAggregateOperationSelectionDropdownContent.tsx
index add1b95c1ad..7c49875ca2e 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAggregateOperationSelectionDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAggregateOperationSelectionDropdownContent.tsx
@@ -11,12 +11,12 @@ import { DASHBOARD_AGGREGATE_OPERATION_RATIO } from '@/page-layout/widgets/graph
import { type AggregateChartOperation } from '@/page-layout/widgets/graph/graph-widget-aggregate-chart/types/AggregateChartOperation';
import { getAggregateChartOperationLabel } from '@/page-layout/widgets/graph/graph-widget-aggregate-chart/utils/getAggregateChartOperationLabel';
import { getAvailableAggregateOperationsForAggregateChart } from '@/page-layout/widgets/graph/graph-widget-aggregate-chart/utils/getAvailableAggregateOperationsForAggregateChart';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
import { doNotTranslate } from 'twenty-shared/i18n';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
+import { useLingui } from '@lingui/react/macro';
type ChartAggregateOperationSelectionDropdownContentProps = {
currentFieldMetadataId: string;
@@ -25,6 +25,7 @@ type ChartAggregateOperationSelectionDropdownContentProps = {
export const ChartAggregateOperationSelectionDropdownContent = ({
currentFieldMetadataId,
}: ChartAggregateOperationSelectionDropdownContentProps) => {
+ const { t } = useLingui();
const [searchQuery, setSearchQuery] = useState('');
const { objectMetadataItems } = useObjectMetadataItems();
const { pageLayoutId } = usePageLayoutSidePanelTarget();
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAxisNameSelectionDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAxisNameSelectionDropdownContent.tsx
index f6ef3274fc8..f9552179486 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAxisNameSelectionDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAxisNameSelectionDropdownContent.tsx
@@ -1,5 +1,4 @@
import { ChartSettingsDropdownSection } from '@/side-panel/pages/page-layout/components/chart-settings/ChartSettingsDropdownSection';
-import { t } from '@lingui/core/macro';
import { Dropdown } from 'twenty-ui/components/navigation';
import { usePageLayoutSidePanelTarget } from '@/side-panel/pages/page-layout/hooks/usePageLayoutSidePanelTarget';
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
@@ -8,8 +7,10 @@ import { getChartAxisNameDisplayOptions } from '@/side-panel/pages/page-layout/u
import { isWidgetConfigurationOfType } from '@/side-panel/pages/page-layout/utils/isWidgetConfigurationOfType';
import { AxisNameDisplay } from '~/generated-metadata/graphql';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
export const ChartAxisNameSelectionDropdownContent = () => {
+ const { t } = useLingui();
const { pageLayoutId } = usePageLayoutSidePanelTarget();
const { widgetInEditMode } = useWidgetInEditMode(pageLayoutId);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorPaletteOption.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorPaletteOption.tsx
index d3c9ca09dfa..0a9ff6727a5 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorPaletteOption.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorPaletteOption.tsx
@@ -2,11 +2,11 @@ import { CHART_SETTINGS_PALETTE_COLOR_GROUP_COUNT } from '@/side-panel/pages/pag
import { createGraphColorRegistry } from '@/page-layout/widgets/graph/utils/createGraphColorRegistry';
import { getColorSchemeByIndex } from '@/page-layout/widgets/graph/utils/getColorSchemeByIndex';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { ColorSample } from 'twenty-ui/primitives/data-display';
import { Dropdown } from 'twenty-ui/components/navigation';
import { getMainColorNameFromPaletteColorName } from 'twenty-ui/utilities';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledColorSamplesContainer = styled.div`
align-items: center;
@@ -15,6 +15,7 @@ const StyledColorSamplesContainer = styled.div`
`;
export const ChartColorPaletteOption = () => {
+ const { t } = useLingui();
const theme = useTheme();
const colorRegistry = createGraphColorRegistry(theme.color);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorSelectionDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorSelectionDropdownContent.tsx
index d7789743812..8f77eee0b6a 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorSelectionDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorSelectionDropdownContent.tsx
@@ -6,13 +6,13 @@ import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWid
import { type ChartConfiguration } from '@/side-panel/pages/page-layout/types/ChartConfiguration';
import { isWidgetConfigurationOfType } from '@/side-panel/pages/page-layout/utils/isWidgetConfigurationOfType';
import { ChartSettingsDropdownSection } from '@/side-panel/pages/page-layout/components/chart-settings/ChartSettingsDropdownSection';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { capitalize, isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
import { Dropdown } from 'twenty-ui/components/navigation';
import { MAIN_COLOR_NAMES, type ThemeColor } from 'twenty-ui/theme';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
+import { useLingui } from '@lingui/react/macro';
type ColorOption = {
id: string;
@@ -21,6 +21,7 @@ type ColorOption = {
};
export const ChartColorSelectionDropdownContent = () => {
+ const { t } = useLingui();
const [searchQuery, setSearchQuery] = useState('');
const { pageLayoutId } = usePageLayoutSidePanelTarget();
const { widgetInEditMode } = useWidgetInEditMode(pageLayoutId);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDataSourceDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDataSourceDropdownContent.tsx
index d3fb71015af..7c5b58210b2 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDataSourceDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDataSourceDropdownContent.tsx
@@ -8,13 +8,14 @@ import { useResetChartDraftFiltersSettings } from '@/side-panel/pages/page-layou
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
import { ChartSettingsDropdownSection } from '@/side-panel/pages/page-layout/components/chart-settings/ChartSettingsDropdownSection';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
+import { useLingui } from '@lingui/react/macro';
export const ChartDataSourceDropdownContent = () => {
+ const { t } = useLingui();
const [searchQuery, setSearchQuery] = useState('');
const { objectMetadataItems } = useObjectMetadataItems();
const { objectPermissionsByObjectMetadataId } = useObjectPermissions();
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDateGranularitySelectionDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDateGranularitySelectionDropdownContent.tsx
index 1a98c7261f0..9ad2c555783 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDateGranularitySelectionDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDateGranularitySelectionDropdownContent.tsx
@@ -1,5 +1,4 @@
import { ChartSettingsDropdownSection } from '@/side-panel/pages/page-layout/components/chart-settings/ChartSettingsDropdownSection';
-import { t } from '@lingui/core/macro';
import { Dropdown } from 'twenty-ui/components/navigation';
import { usePageLayoutSidePanelTarget } from '@/side-panel/pages/page-layout/hooks/usePageLayoutSidePanelTarget';
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
@@ -15,6 +14,7 @@ import {
type FieldsConfiguration,
type WidgetConfiguration,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type ChartDateGranularitySelectionDropdownContentProps = {
axis?: 'primary' | 'secondary';
@@ -69,6 +69,7 @@ const isChartConfiguration = (
export const ChartDateGranularitySelectionDropdownContent = ({
axis,
}: ChartDateGranularitySelectionDropdownContentProps) => {
+ const { t } = useLingui();
const { pageLayoutId } = usePageLayoutSidePanelTarget();
const { widgetInEditMode } = useWidgetInEditMode(pageLayoutId);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartFieldSelectionForAggregateOperationDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartFieldSelectionForAggregateOperationDropdownContent.tsx
index 3e5ecf5cba9..e751212c4aa 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartFieldSelectionForAggregateOperationDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartFieldSelectionForAggregateOperationDropdownContent.tsx
@@ -9,7 +9,6 @@ import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadat
import { isHiddenSystemField } from '@/object-metadata/utils/isHiddenSystemField';
import { isFieldRelation } from '@/object-record/record-field/ui/types/guards/isFieldRelation';
import { getChartAggregateDropdownPageId } from '@/side-panel/pages/page-layout/utils/getChartAggregateDropdownPageId';
-import { t } from '@lingui/core/macro';
import { Fragment, useState } from 'react';
import { IconCheck } from 'twenty-ui/icon';
import { useIcons } from 'twenty-ui/icon/provider';
@@ -17,8 +16,10 @@ import { Dropdown } from 'twenty-ui/components/navigation';
import { isNonEmptyArray } from 'twenty-shared/utils';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
export const ChartFieldSelectionForAggregateOperationDropdownContent = () => {
+ const { t } = useLingui();
const [searchQuery, setSearchQuery] = useState('');
const { objectMetadataItems } = useObjectMetadataItems();
const { pageLayoutId } = usePageLayoutSidePanelTarget();
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionDropdownContentBase.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionDropdownContentBase.tsx
index aff636994d1..72af515e40a 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionDropdownContentBase.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionDropdownContentBase.tsx
@@ -10,7 +10,6 @@ import { ChartGroupByFieldSelectionContext } from '@/side-panel/pages/page-layou
import { useChartGroupByFieldSelection } from '@/side-panel/pages/page-layout/hooks/useChartGroupByFieldSelection';
import { type ChartGroupByFieldSelectionAxis } from '@/side-panel/pages/page-layout/types/ChartGroupByFieldSelectionAxis';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { t } from '@lingui/core/macro';
import { useMemo, useState } from 'react';
import {
isDefined,
@@ -22,6 +21,7 @@ import { useIcons } from 'twenty-ui/icon/provider';
import { normalizeSearchText } from 'twenty-ui/utilities';
import { RelationType } from '~/generated-metadata/graphql';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
+import { useLingui } from '@lingui/react/macro';
type ChartGroupByFieldSelectionDropdownContentBaseProps = {
axis: ChartGroupByFieldSelectionAxis;
@@ -30,6 +30,7 @@ type ChartGroupByFieldSelectionDropdownContentBaseProps = {
export const ChartGroupByFieldSelectionDropdownContentBase = ({
axis,
}: ChartGroupByFieldSelectionDropdownContentBaseProps) => {
+ const { t } = useLingui();
const [searchQuery, setSearchQuery] = useState('');
const selection = useChartGroupByFieldSelection({ axis });
const { getIcon } = useIcons();
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionMorphRelationFieldView.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionMorphRelationFieldView.tsx
index f731e3dcec8..9531ddf4e42 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionMorphRelationFieldView.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionMorphRelationFieldView.tsx
@@ -3,12 +3,12 @@ import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataIte
import { ChartGroupByFieldSelectionTargetObjectFieldsView } from '@/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView';
import { ChartSettingsDropdownSection } from '@/side-panel/pages/page-layout/components/chart-settings/ChartSettingsDropdownSection';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { t } from '@lingui/core/macro';
import { useMemo } from 'react';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
import { useIcons } from 'twenty-ui/icon/provider';
import { RelationType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type ChartGroupByFieldSelectionMorphRelationFieldViewProps = {
pageId: string;
@@ -19,6 +19,7 @@ export const ChartGroupByFieldSelectionMorphRelationFieldView = ({
pageId,
morphField,
}: ChartGroupByFieldSelectionMorphRelationFieldViewProps) => {
+ const { t } = useLingui();
const { getIcon } = useIcons();
const { objectMetadataItems } = useObjectMetadataItems();
const availableTargets = useMemo(
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView.tsx
index f5f94e17c64..983cdc9eef2 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView.tsx
@@ -5,13 +5,13 @@ import { ChartSettingsDropdownSection } from '@/side-panel/pages/page-layout/com
import { useChartGroupByFieldSelectionContextOrThrow } from '@/side-panel/pages/page-layout/hooks/useChartGroupByFieldSelectionContextOrThrow';
import { isFieldSupportedAsChartGroupBySubField } from '@/side-panel/pages/page-layout/utils/isFieldSupportedAsChartGroupBySubField';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
import { useIcons } from 'twenty-ui/icon/provider';
import { normalizeSearchText } from 'twenty-ui/utilities';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
+import { useLingui } from '@lingui/react/macro';
type ChartGroupByFieldSelectionTargetObjectFieldsViewProps = {
pageId: string;
@@ -26,6 +26,7 @@ export const ChartGroupByFieldSelectionTargetObjectFieldsView = ({
headerLabel,
fieldMetadataId,
}: ChartGroupByFieldSelectionTargetObjectFieldsViewProps) => {
+ const { t } = useLingui();
const { getIcon } = useIcons();
const { currentGroupByFieldMetadataId, currentSubFieldName, selectField } =
useChartGroupByFieldSelectionContextOrThrow();
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartManualSortSubMenuContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartManualSortSubMenuContent.tsx
index 5327177e4e4..4abc84bf573 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartManualSortSubMenuContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartManualSortSubMenuContent.tsx
@@ -13,11 +13,11 @@ import { getManualSortOrderFromConfig } from '@/side-panel/pages/page-layout/uti
import { isWidgetConfigurationOfType } from '@/side-panel/pages/page-layout/utils/isWidgetConfigurationOfType';
import { DraggableItem } from '@/ui/layout/draggable-list/components/DraggableItem';
import { DraggableList } from '@/ui/layout/draggable-list/components/DraggableList';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { Tag } from 'twenty-ui/primitives/data-display';
import { type WidgetConfiguration } from '~/generated-metadata/graphql';
import { moveArrayItem } from '~/utils/array/moveArrayItem';
+import { useLingui } from '@lingui/react/macro';
type ChartManualSortSubMenuContentProps = {
fieldMetadataItem: FieldMetadataItem;
@@ -28,6 +28,7 @@ export const ChartManualSortSubMenuContent = ({
fieldMetadataItem,
axis,
}: ChartManualSortSubMenuContentProps) => {
+ const { t } = useLingui();
const { pageLayoutId } = usePageLayoutSidePanelTarget();
const { widgetInEditMode } = useWidgetInEditMode(pageLayoutId);
const { updateCurrentWidgetConfig } =
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartNumberFormatSelectionDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartNumberFormatSelectionDropdownContent.tsx
index 509f8016ec3..5d506c28a3f 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartNumberFormatSelectionDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartNumberFormatSelectionDropdownContent.tsx
@@ -1,5 +1,4 @@
import { ChartSettingsDropdownSection } from '@/side-panel/pages/page-layout/components/chart-settings/ChartSettingsDropdownSection';
-import { t } from '@lingui/core/macro';
import { Dropdown } from 'twenty-ui/components/navigation';
import { CHART_NUMBER_FORMAT_DEFAULT } from '@/page-layout/widgets/graph/constants/ChartNumberFormatDefault';
import { usePageLayoutSidePanelTarget } from '@/side-panel/pages/page-layout/hooks/usePageLayoutSidePanelTarget';
@@ -9,8 +8,10 @@ import { getChartNumberFormatLabel } from '@/side-panel/pages/page-layout/utils/
import { isWidgetConfigurationOfType } from '@/side-panel/pages/page-layout/utils/isWidgetConfigurationOfType';
import { ChartNumberFormat } from '~/generated-metadata/graphql';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
export const ChartNumberFormatSelectionDropdownContent = () => {
+ const { t } = useLingui();
const { pageLayoutId } = usePageLayoutSidePanelTarget();
const { widgetInEditMode } = useWidgetInEditMode(pageLayoutId);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionValueSelectionDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionValueSelectionDropdownContent.tsx
index 2220bf2775d..ca34450ba70 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionValueSelectionDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionValueSelectionDropdownContent.tsx
@@ -4,7 +4,6 @@ import { usePageLayoutSidePanelTarget } from '@/side-panel/pages/page-layout/hoo
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
import { isWidgetConfigurationOfType } from '@/side-panel/pages/page-layout/utils/isWidgetConfigurationOfType';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
@@ -12,6 +11,7 @@ import { ChartSettingsDropdownSection } from '@/side-panel/pages/page-layout/com
import { type ThemeColor } from 'twenty-ui/theme';
import { FieldMetadataType } from '~/generated-metadata/graphql';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
+import { useLingui } from '@lingui/react/macro';
type RatioOption = {
value: string;
@@ -26,6 +26,7 @@ type ChartRatioOptionValueSelectionDropdownContentProps = {
export const ChartRatioOptionValueSelectionDropdownContent = ({
currentFieldMetadataId,
}: ChartRatioOptionValueSelectionDropdownContentProps) => {
+ const { t } = useLingui();
const [searchQuery, setSearchQuery] = useState('');
const { objectMetadataItems } = useObjectMetadataItems();
const { pageLayoutId } = usePageLayoutSidePanelTarget();
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetFieldDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetFieldDropdownContent.tsx
index 4c27d7f9f8f..ef1703ad7aa 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetFieldDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetFieldDropdownContent.tsx
@@ -18,19 +18,20 @@ import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hoo
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
import { FieldWidgetNestedFieldDropdownContent } from '@/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetNestedFieldDropdownContent';
import { ChartSettingsDropdownSection } from '@/side-panel/pages/page-layout/components/chart-settings/ChartSettingsDropdownSection';
-import { t } from '@lingui/core/macro';
import { useMemo, useState } from 'react';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { useIcons } from 'twenty-ui/icon/provider';
import { Dropdown } from 'twenty-ui/components/navigation';
import { FieldDisplayMode } from '~/generated-metadata/graphql';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
+import { useLingui } from '@lingui/react/macro';
type FieldWidgetFieldSelectionRow =
| { type: 'navigation'; fieldMetadataItem: FieldMetadataItem }
| { type: 'options'; fieldMetadataItems: FieldMetadataItem[] };
export const FieldWidgetFieldDropdownContent = () => {
+ const { t } = useLingui();
const [searchQuery, setSearchQuery] = useState('');
const { pageLayoutId, targetRecordIdentifier } =
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/MoveToTabDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/MoveToTabDropdownContent.tsx
index de6f69e3390..26bcc11a76c 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/MoveToTabDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/MoveToTabDropdownContent.tsx
@@ -5,11 +5,12 @@ import { pageLayoutEditingWidgetIdComponentState } from '@/page-layout/states/pa
import { canVerticalListAcceptWidget } from '@/page-layout/utils/canVerticalListAcceptWidget';
import { usePageLayoutSidePanelTarget } from '@/side-panel/pages/page-layout/hooks/usePageLayoutSidePanelTarget';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { PageLayoutTabLayoutMode } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const MoveToTabDropdownContent = () => {
+ const { t } = useLingui();
const { pageLayoutId } = usePageLayoutSidePanelTarget();
const pageLayoutDraft = useAtomComponentStateValue(
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarFieldDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarFieldDropdownContent.tsx
index abe726bd39f..ab4e7ad39c6 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarFieldDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarFieldDropdownContent.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { ChartSettingsDropdownSection } from '@/side-panel/pages/page-layout/components/chart-settings/ChartSettingsDropdownSection';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
@@ -6,6 +5,7 @@ import { useRecordTableWidgetLayoutCallbacks } from '@/page-layout/widgets/recor
import { isFieldMetadataItemAvailableAsCalendarField } from '@/object-record/record-calendar/utils/isFieldMetadataItemAvailableAsCalendarField';
import { useIcons } from 'twenty-ui/icon/provider';
import { Dropdown } from 'twenty-ui/components/navigation';
+import { useLingui } from '@lingui/react/macro';
type RecordTableCalendarFieldDropdownContentProps = {
pageLayoutId: string;
@@ -20,6 +20,7 @@ export const RecordTableCalendarFieldDropdownContent = ({
objectMetadataId,
currentCalendarFieldMetadataId,
}: RecordTableCalendarFieldDropdownContentProps) => {
+ const { t } = useLingui();
const { getIcon } = useIcons();
const { objectMetadataItems } = useObjectMetadataItems();
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarLayoutDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarLayoutDropdownContent.tsx
index 47f28e711b2..adab8856a7a 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarLayoutDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarLayoutDropdownContent.tsx
@@ -1,7 +1,6 @@
import { ChartSettingsDropdownSection } from '@/side-panel/pages/page-layout/components/chart-settings/ChartSettingsDropdownSection';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useRecordTableWidgetLayoutCallbacks } from '@/page-layout/widgets/record-table/hooks/useRecordTableWidgetLayoutCallbacks';
-import { t } from '@lingui/core/macro';
import {
IconCalendarEvent,
IconCalendarMonth,
@@ -9,6 +8,7 @@ import {
} from 'twenty-ui/icon';
import { Dropdown } from 'twenty-ui/components/navigation';
import { ViewCalendarLayout } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type RecordTableCalendarLayoutDropdownContentProps = {
pageLayoutId: string;
@@ -21,6 +21,7 @@ export const RecordTableCalendarLayoutDropdownContent = ({
widgetId,
currentCalendarLayout,
}: RecordTableCalendarLayoutDropdownContentProps) => {
+ const { t } = useLingui();
const { handleCalendarLayoutChange } = useRecordTableWidgetLayoutCallbacks({
pageLayoutId,
widgetId,
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableDataSourceDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableDataSourceDropdownContent.tsx
index 619faa686bb..fdd091ca25e 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableDataSourceDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableDataSourceDropdownContent.tsx
@@ -10,13 +10,14 @@ import { useRemoveDraftViewForRecordTableWidget } from '@/page-layout/widgets/re
import { usePageLayoutSidePanelTarget } from '@/side-panel/pages/page-layout/hooks/usePageLayoutSidePanelTarget';
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
+import { useLingui } from '@lingui/react/macro';
export const RecordTableDataSourceDropdownContent = () => {
+ const { t } = useLingui();
const [searchQuery, setSearchQuery] = useState('');
const { objectMetadataItems } = useObjectMetadataItems();
const { objectPermissionsByObjectMetadataId } = useObjectPermissions();
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownHiddenFieldsContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownHiddenFieldsContent.tsx
index 62658eb3bcd..0ee4dd40ad7 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownHiddenFieldsContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownHiddenFieldsContent.tsx
@@ -8,7 +8,6 @@ import { currentRecordFieldsComponentState } from '@/object-record/record-field/
import { type RecordField } from '@/object-record/record-field/types/RecordField';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconEye } from 'twenty-ui/icon';
@@ -16,6 +15,7 @@ import { useIcons } from 'twenty-ui/icon/provider';
import { ListItem } from 'twenty-ui/primitives/navigation';
import { v4 } from 'uuid';
import { sortByProperty } from '~/utils/array/sortByProperty';
+import { useLingui } from '@lingui/react/macro';
type RecordTableFieldsDropdownHiddenFieldsContentProps = {
objectMetadataId: string;
@@ -33,6 +33,7 @@ export const RecordTableFieldsDropdownHiddenFieldsContent = ({
onFieldUpdated,
onFieldCreated,
}: RecordTableFieldsDropdownHiddenFieldsContentProps) => {
+ const { t } = useLingui();
const { objectMetadataItem } = useObjectMetadataItemById({
objectId: objectMetadataId,
});
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownVisibleFieldsContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownVisibleFieldsContent.tsx
index 0986ea1a7b6..48441d0e3eb 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownVisibleFieldsContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownVisibleFieldsContent.tsx
@@ -12,13 +12,13 @@ import { DraggableItem } from '@/ui/layout/draggable-list/components/DraggableIt
import { DraggableList } from '@/ui/layout/draggable-list/components/DraggableList';
import { type DraggableListDropResult } from '@/ui/layout/draggable-list/types/DraggableListDropResult';
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
-import { t } from '@lingui/core/macro';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { LightIconButton } from 'twenty-ui/components/input';
import { Dropdown } from 'twenty-ui/components/navigation';
import { IconEyeOff } from 'twenty-ui/icon';
import { useIcons } from 'twenty-ui/icon/provider';
import { sortByProperty } from '~/utils/array/sortByProperty';
+import { useLingui } from '@lingui/react/macro';
type RecordTableFieldsDropdownVisibleFieldsContentProps = {
objectMetadataId: string;
@@ -34,6 +34,7 @@ export const RecordTableFieldsDropdownVisibleFieldsContent = ({
recordIndexId,
onFieldUpdated,
}: RecordTableFieldsDropdownVisibleFieldsContentProps) => {
+ const { t } = useLingui();
const { objectMetadataItem } = useObjectMetadataItemById({
objectId: objectMetadataId,
});
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableGroupByDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableGroupByDropdownContent.tsx
index 787c9b8964e..319f79b3243 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableGroupByDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableGroupByDropdownContent.tsx
@@ -3,12 +3,12 @@ import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { useRecordTableWidgetLayoutCallbacks } from '@/page-layout/widgets/record-table/hooks/useRecordTableWidgetLayoutCallbacks';
import { isFieldMetadataItemAvailableAsWidgetGroupByField } from '@/page-layout/widgets/record-table/utils/isFieldMetadataItemAvailableAsWidgetGroupByField';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { isNonEmptyArray } from 'twenty-shared/utils';
import { useIcons } from 'twenty-ui/icon/provider';
import { Dropdown } from 'twenty-ui/components/navigation';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
+import { useLingui } from '@lingui/react/macro';
const NO_GROUP_BY_ITEM_ID = 'no-group-by';
@@ -27,6 +27,7 @@ export const RecordTableGroupByDropdownContent = ({
currentMainGroupByFieldMetadataId,
isClearable = true,
}: RecordTableGroupByDropdownContentProps) => {
+ const { t } = useLingui();
const [searchQuery, setSearchQuery] = useState('');
const { getIcon } = useIcons();
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableLayoutDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableLayoutDropdownContent.tsx
index 74ca00d45d5..515a7378e24 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableLayoutDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableLayoutDropdownContent.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { ChartSettingsDropdownSection } from '@/side-panel/pages/page-layout/components/chart-settings/ChartSettingsDropdownSection';
import { Dropdown } from 'twenty-ui/components/navigation';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
@@ -7,6 +6,7 @@ import { useRecordTableWidgetLayoutPickerOptions } from '@/page-layout/widgets/r
import { type RecordTableWidgetLayoutViewType } from '@/page-layout/widgets/record-table/types/RecordTableWidgetLayoutViewType';
import { isSelectableLayout } from '@/page-layout/widgets/record-table/utils/getRecordTableWidgetLayoutPickerOptions';
import { RecordTableWidgetLayoutMenuItems } from '@/side-panel/pages/page-layout/components/record-table-settings/RecordTableWidgetLayoutMenuItems';
+import { useLingui } from '@lingui/react/macro';
type RecordTableLayoutDropdownContentProps = {
pageLayoutId: string;
@@ -21,6 +21,7 @@ export const RecordTableLayoutDropdownContent = ({
objectMetadataId,
currentLayoutViewType,
}: RecordTableLayoutDropdownContentProps) => {
+ const { t } = useLingui();
const { objectMetadataItems } = useObjectMetadataItems();
const objectMetadataItem = objectMetadataItems.find(
(objectMetadataItemToFind) =>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsFieldVisibility.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsFieldVisibility.tsx
index 166290e4ee6..7953e432b83 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsFieldVisibility.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsFieldVisibility.tsx
@@ -7,12 +7,12 @@ import { DraggableItem } from '@/ui/layout/draggable-list/components/DraggableIt
import { DraggableList } from '@/ui/layout/draggable-list/components/DraggableList';
import { type DraggableListDropResult } from '@/ui/layout/draggable-list/types/DraggableListDropResult';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useMemo } from 'react';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconEye, IconEyeOff } from 'twenty-ui/icon';
import { useIcons } from 'twenty-ui/icon/provider';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledFieldListContainer = styled.div`
display: flex;
@@ -40,6 +40,7 @@ export const RecordTableSettingsFieldVisibility = ({
widgetId,
pageLayoutId,
}: RecordTableSettingsFieldVisibilityProps) => {
+ const { t } = useLingui();
const { recordTableWidgetViewFieldItems } =
useRecordTableWidgetViewFieldItems({ viewId, widgetId, pageLayoutId });
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsFilters.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsFilters.tsx
index 501860ca47b..ca3dac41eb4 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsFilters.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsFilters.tsx
@@ -8,9 +8,9 @@ import { useRecordTableWidgetViewForDisplay } from '@/page-layout/widgets/record
import { RecordTableSettingsFiltersInitializeStateEffect } from '@/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsFiltersInitializeStateEffect';
import { InputLabel } from '@/ui/input/components/internal/InputLabel/InputLabel';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledFilterSettingsContainer = styled.div`
display: flex;
@@ -32,6 +32,7 @@ export const RecordTableSettingsFilters = ({
pageLayoutId,
objectMetadataId,
}: RecordTableSettingsFiltersProps) => {
+ const { t } = useLingui();
const { view } = useRecordTableWidgetViewForDisplay({
viewId,
widgetId,
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsSorts.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsSorts.tsx
index 4d81bb0902f..ca79cb15899 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsSorts.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsSorts.tsx
@@ -8,12 +8,12 @@ import { RecordTableSettingsSortsContent } from '@/side-panel/pages/page-layout/
import { RecordTableSettingsSortsInitializeStateEffect } from '@/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsSortsInitializeStateEffect';
import { InputLabel } from '@/ui/input/components/internal/InputLabel/InputLabel';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { useIcons } from 'twenty-ui/icon/provider';
import { type SelectOption } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
import { ViewSortDirection } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledSortSettingsContainer = styled.div`
display: flex;
@@ -35,6 +35,7 @@ export const RecordTableSettingsSorts = ({
pageLayoutId,
objectMetadataId,
}: RecordTableSettingsSortsProps) => {
+ const { t } = useLingui();
const { view } = useRecordTableWidgetViewForDisplay({
viewId,
widgetId,
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsSortsContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsSortsContent.tsx
index a351b2d6acf..d5076f389b5 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsSortsContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsSortsContent.tsx
@@ -2,7 +2,6 @@ import { type RecordSort } from '@/object-record/record-sort/types/RecordSort';
import { currentRecordSortsComponentState } from '@/object-record/record-sort/states/currentRecordSortsComponentState';
import { useAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconArrowsSort, IconTrash } from 'twenty-ui/icon';
import { Button, type SelectOption } from 'twenty-ui/primitives/input';
@@ -10,6 +9,7 @@ import { Select } from '@/ui/input/components/Select';
import { themeCssVariables } from 'twenty-ui/theme';
import { v4 as uuidv4 } from 'uuid';
import { ViewSortDirection } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledSortItemContainer = styled.div`
align-items: center;
@@ -32,6 +32,7 @@ export const RecordTableSettingsSortsContent = ({
directionOptions,
onUpdate,
}: RecordTableSettingsSortsContentProps) => {
+ const { t } = useLingui();
const [currentRecordSorts, setCurrentRecordSorts] = useAtomComponentState(
currentRecordSortsComponentState,
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useChartSettingsValues.ts b/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useChartSettingsValues.ts
index 83694ecf9b3..86372da9089 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useChartSettingsValues.ts
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useChartSettingsValues.ts
@@ -12,11 +12,12 @@ import { getFieldLabelWithSubField } from '@/side-panel/pages/page-layout/utils/
import { objectMetadataItemsSelector } from '@/object-metadata/states/objectMetadataItemsSelector';
import { getAggregateOperationLabel } from '@/object-record/record-board/record-board-column/utils/getAggregateOperationLabel';
import { convertAggregateOperationToExtendedAggregateOperation } from '@/object-record/utils/convertAggregateOperationToExtendedAggregateOperation';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { type CompositeFieldSubFieldName } from 'twenty-shared/types';
import { capitalize, isDefined } from 'twenty-shared/utils';
import { type GraphOrderBy } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useChartSettingsValues = ({
objectMetadataId,
@@ -25,6 +26,7 @@ export const useChartSettingsValues = ({
objectMetadataId: string;
configuration?: ChartConfiguration;
}) => {
+ const { t } = useLingui();
const objectMetadataItems = useAtomStateValue(objectMetadataItemsSelector);
const objectMetadataItem = objectMetadataItems.find(
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useGraphGroupBySortOptionLabels.ts b/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useGraphGroupBySortOptionLabels.ts
index 7ef2ef46847..d1b17c13859 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useGraphGroupBySortOptionLabels.ts
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useGraphGroupBySortOptionLabels.ts
@@ -2,17 +2,18 @@ import { findFieldMetadataItemByFieldMetadataId } from '@/object-metadata/utils/
import { getFieldLabelWithSubField } from '@/side-panel/pages/page-layout/utils/getFieldLabelWithSubField';
import { getSortLabelSuffixForFieldType } from '@/side-panel/pages/page-layout/utils/getSortLabelSuffixForFieldType';
import { objectMetadataItemsSelector } from '@/object-metadata/states/objectMetadataItemsSelector';
-import { t } from '@lingui/core/macro';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { type CompositeFieldSubFieldName } from 'twenty-shared/types';
import { assertUnreachable } from 'twenty-shared/utils';
import { GraphOrderBy } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useGraphGroupBySortOptionLabels = ({
objectMetadataId,
}: {
objectMetadataId: string;
}) => {
+ const { t } = useLingui();
const objectMetadataItems = useAtomStateValue(objectMetadataItemsSelector);
const objectMetadataItem = objectMetadataItems.find(
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useGraphXSortOptionLabels.ts b/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useGraphXSortOptionLabels.ts
index 5937d366a4d..19ba1337c45 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useGraphXSortOptionLabels.ts
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useGraphXSortOptionLabels.ts
@@ -4,16 +4,17 @@ import { getSortLabelSuffixForFieldType } from '@/side-panel/pages/page-layout/u
import { objectMetadataItemsSelector } from '@/object-metadata/states/objectMetadataItemsSelector';
import { getAggregateOperationLabel } from '@/object-record/record-board/record-board-column/utils/getAggregateOperationLabel';
import { type ExtendedAggregateOperations } from '@/object-record/record-table/types/ExtendedAggregateOperations';
-import { t } from '@lingui/core/macro';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { assertUnreachable, isDefined } from 'twenty-shared/utils';
import { GraphOrderBy } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useGraphXSortOptionLabels = ({
objectMetadataId,
}: {
objectMetadataId: string;
}) => {
+ const { t } = useLingui();
const objectMetadataItems = useAtomStateValue(objectMetadataItemsSelector);
const objectMetadataItem = objectMetadataItems.find(
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useRecordTableSettingsDescriptions.ts b/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useRecordTableSettingsDescriptions.ts
index 9f360503425..73b43d917c8 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useRecordTableSettingsDescriptions.ts
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/useRecordTableSettingsDescriptions.ts
@@ -6,8 +6,8 @@ import { getRecordIndexIdFromObjectNamePluralAndViewId } from '@/object-record/u
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useViewById } from '@/views/hooks/useViewById';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
const PLACEHOLDER_INSTANCE_ID =
'record-table-settings-descriptions-placeholder';
@@ -21,6 +21,7 @@ export const useRecordTableSettingsDescriptions = ({
objectMetadataId,
viewId,
}: UseRecordTableSettingsDescriptionsParams) => {
+ const { t } = useLingui();
const { objectMetadataItems } = useObjectMetadataItems();
const { view } = useViewById(viewId);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/record-creation-form/components/SidePanelRecordCreationFormPage.tsx b/packages/twenty-front/src/modules/side-panel/pages/record-creation-form/components/SidePanelRecordCreationFormPage.tsx
index d545035ec51..336214007fc 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/record-creation-form/components/SidePanelRecordCreationFormPage.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/record-creation-form/components/SidePanelRecordCreationFormPage.tsx
@@ -36,7 +36,6 @@ import { useStore } from 'jotai';
import { useId, useState } from 'react';
import { flushSync } from 'react-dom';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Key } from 'ts-key-enum';
import { type JsonValue } from 'type-fest';
import { PermissionFlagType } from 'twenty-shared/constants';
@@ -52,6 +51,7 @@ import {
} from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: flex;
@@ -114,6 +114,7 @@ const SidePanelRecordCreationForm = ({
initialDraftRecord: Partial<ObjectRecord>;
canCreateAnother: boolean;
}) => {
+ const { t } = useLingui();
const { objectMetadataItem } = useObjectMetadataItemById({
objectId: objectMetadataId,
});
diff --git a/packages/twenty-front/src/modules/side-panel/pages/send-campaign-test/components/SidePanelSendCampaignTestPage.tsx b/packages/twenty-front/src/modules/side-panel/pages/send-campaign-test/components/SidePanelSendCampaignTestPage.tsx
index 7f224cb4795..1bab2313746 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/send-campaign-test/components/SidePanelSendCampaignTestPage.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/send-campaign-test/components/SidePanelSendCampaignTestPage.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { isNonEmptyString } from '@sniptt/guards';
@@ -19,6 +18,7 @@ import { SidePanelFooter } from '@/ui/layout/side-panel/components/SidePanelFoot
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: flex;
@@ -36,6 +36,7 @@ const StyledContent = styled.div`
`;
export const SidePanelSendCampaignTestPage = () => {
+ const { t } = useLingui();
const sendCampaignTestCampaignId = useAtomComponentStateValue(
sendCampaignTestCampaignIdComponentState,
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/send-campaign/components/SendCampaignForm.tsx b/packages/twenty-front/src/modules/side-panel/pages/send-campaign/components/SendCampaignForm.tsx
index ae77bc38c61..a44e0186d79 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/send-campaign/components/SendCampaignForm.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/send-campaign/components/SendCampaignForm.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useState } from 'react';
import { Key } from 'ts-key-enum';
@@ -32,6 +31,7 @@ import { SendCampaignRecipientsCard } from '@/side-panel/pages/send-campaign/com
import { FormFieldInputContainer } from '@/ui/input/components/FormFieldInputContainer';
import { SidePanelFooter } from '@/ui/layout/side-panel/components/SidePanelFooter';
import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: flex;
@@ -53,6 +53,7 @@ type SendCampaignFormProps = {
};
export const SendCampaignForm = ({ campaign }: SendCampaignFormProps) => {
+ const { t } = useLingui();
const isAlreadyScheduled =
campaign.status === MessageCampaignStatus.SCHEDULED;
const hasList = isNonEmptyString(campaign.listId);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/send-campaign/components/SendCampaignRecipientsCard.tsx b/packages/twenty-front/src/modules/side-panel/pages/send-campaign/components/SendCampaignRecipientsCard.tsx
index 791b70c41fc..e705e398988 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/send-campaign/components/SendCampaignRecipientsCard.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/send-campaign/components/SendCampaignRecipientsCard.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import {
IconBellOff,
@@ -16,6 +15,7 @@ import { themeCssVariables } from 'twenty-ui/theme';
import { useNumberFormat } from '@/localization/hooks/useNumberFormat';
import { SettingsListItemCardContent } from '@/settings/components/SettingsListItemCardContent';
import { type CampaignAudiencePreviewDto } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledCount = styled.span`
color: ${themeCssVariables.font.color.tertiary};
@@ -34,6 +34,7 @@ export const SendCampaignRecipientsCard = ({
listName,
topicName,
}: SendCampaignRecipientsCardProps) => {
+ const { t } = useLingui();
const { formatNumber } = useNumberFormat();
const exclusions = [
diff --git a/packages/twenty-front/src/modules/side-panel/pages/workflow/step/view-run/components/SidePanelWorkflowRunViewStepContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/workflow/step/view-run/components/SidePanelWorkflowRunViewStepContent.tsx
index 7cf3f9221bd..15f63c23c59 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/workflow/step/view-run/components/SidePanelWorkflowRunViewStepContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/workflow/step/view-run/components/SidePanelWorkflowRunViewStepContent.tsx
@@ -26,7 +26,6 @@ import {
import { getWorkflowRunStepExecutionStatus } from '@/workflow/workflow-steps/utils/getWorkflowRunStepExecutionStatus';
import { WorkflowIteratorSubStepSwitcher } from '@/workflow/workflow-steps/workflow-actions/iterator-action/components/WorkflowIteratorSubStepSwitcher';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNull } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
@@ -37,6 +36,7 @@ import {
IconTerminal,
} from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: flex;
@@ -52,6 +52,7 @@ const StyledTabListContainer = styled.div`
type TabId = WorkflowRunTabIdType;
export const SidePanelWorkflowRunViewStepContent = () => {
+ const { t } = useLingui();
const flow = useFlowOrThrow();
const workflowSelectedNode = useAtomComponentStateValue(
workflowSelectedNodeComponentState,
diff --git a/packages/twenty-front/src/modules/side-panel/pages/workflow/trigger-type/components/SidePanelWorkflowSelectTriggerTypeContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/workflow/trigger-type/components/SidePanelWorkflowSelectTriggerTypeContent.tsx
index f1d990ebe04..f0fb8c67675 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/workflow/trigger-type/components/SidePanelWorkflowSelectTriggerTypeContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/workflow/trigger-type/components/SidePanelWorkflowSelectTriggerTypeContent.tsx
@@ -16,14 +16,15 @@ import { DATABASE_TRIGGER_TYPES } from '@/workflow/workflow-trigger/constants/Da
import { OTHER_TRIGGER_TYPES } from '@/workflow/workflow-trigger/constants/OtherTriggerTypes';
import { useUpdateTrigger } from '@/workflow/workflow-trigger/hooks/useUpdateTrigger';
import { getTriggerDefaultDefinition } from '@/workflow/workflow-trigger/utils/getTriggerDefaultDefinition';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { TRIGGER_STEP_ID } from 'twenty-shared/workflow';
import { ListItemButton } from 'twenty-ui/components/navigation';
import { useIcons } from 'twenty-ui/icon/provider';
import { useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
export const SidePanelWorkflowSelectTriggerTypeContent = () => {
+ const { t } = useLingui();
const theme = useTheme();
const { getIcon } = useIcons();
const workflowId = useSidePanelWorkflowIdOrThrow();
diff --git a/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockPage.tsx b/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockPage.tsx
index b8df728f36b..b341d15f39a 100644
--- a/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockPage.tsx
+++ b/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockPage.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { TintedIconTile } from 'twenty-ui/components/data-display';
import { LightIconButton } from 'twenty-ui/components/input';
import {
@@ -15,6 +14,7 @@ import { BackgroundMockTable } from '@/sign-in-background-mock/components/Backgr
import { BackgroundMockViewBar } from '@/sign-in-background-mock/components/BackgroundMockViewBar';
import { PageCardHeader } from '@/ui/layout/page/components/PageCardHeader';
import { PageCardLayout } from '@/ui/layout/page/components/PageCardLayout';
+import { useLingui } from '@lingui/react/macro';
const StyledTableContainer = styled.div`
display: flex;
@@ -26,6 +26,7 @@ const StyledTableContainer = styled.div`
`;
export const BackgroundMockPage = () => {
+ const { t } = useLingui();
const theme = useTheme();
return (
diff --git a/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockTable.tsx b/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockTable.tsx
index 74aa2321cb8..29f4c97d617 100644
--- a/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockTable.tsx
+++ b/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockTable.tsx
@@ -1,6 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
import { BackgroundMockTableRow } from '@/sign-in-background-mock/components/BackgroundMockTableRow';
import { BACKGROUND_MOCK_COLUMNS } from '@/sign-in-background-mock/constants/BackgroundMockColumns';
import { BACKGROUND_MOCK_COMPANIES } from '@/sign-in-background-mock/constants/BackgroundMockCompanies';
@@ -10,6 +8,7 @@ import { IconChevronDown, IconPlus } from 'twenty-ui/icon';
import { useIcons } from 'twenty-ui/icon/provider';
import { Checkbox } from 'twenty-ui/primitives/input';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledTableWrapper = styled.div`
display: flex;
@@ -149,6 +148,7 @@ const StyledLastEmptyCell = styled.div`
`;
export const BackgroundMockTable = () => {
+ const { t } = useLingui();
const theme = useTheme();
const { getIcon } = useIcons();
diff --git a/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockTableRow.tsx b/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockTableRow.tsx
index 08073ece365..e1989e601d5 100644
--- a/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockTableRow.tsx
+++ b/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockTableRow.tsx
@@ -1,6 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
import { type BackgroundMockCompany } from '@/sign-in-background-mock/constants/BackgroundMockCompanies';
import { BACKGROUND_MOCK_COLUMN_WIDTHS } from '@/sign-in-background-mock/constants/BackgroundMockColumnWidths';
import { BACKGROUND_MOCK_TABLE_DIMENSIONS } from '@/sign-in-background-mock/constants/BackgroundMockTableDimensions';
@@ -11,6 +9,7 @@ import { IconLink } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { getLogoUrlFromDomainName } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
const StyledRow = styled.div`
display: flex;
@@ -96,6 +95,7 @@ const PersonChip = ({ fullName }: { fullName: string | null }) => {
export const BackgroundMockTableRow = ({
company,
}: BackgroundMockTableRowProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const logoUrl = getLogoUrlFromDomainName(company.domainName);
diff --git a/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockViewBar.tsx b/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockViewBar.tsx
index 5283181053e..4fbdf89b350 100644
--- a/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockViewBar.tsx
+++ b/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockViewBar.tsx
@@ -1,10 +1,9 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
import { TopBar } from '@/ui/layout/top-bar/components/TopBar';
import { TintedIconTile } from 'twenty-ui/components/data-display';
import { IconBuildingSkyscraper, IconChevronDown } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledViewPicker = styled.div`
align-items: center;
@@ -31,6 +30,7 @@ const StyledRightAction = styled.div`
`;
export const BackgroundMockViewBar = () => {
+ const { t } = useLingui();
const theme = useTheme();
return (
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalCloseButton.tsx b/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalCloseButton.tsx
index 2e7783c81de..cb073dac6e8 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalCloseButton.tsx
+++ b/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalCloseButton.tsx
@@ -1,8 +1,8 @@
-import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { IconX } from 'twenty-ui/icon';
import { IconButton } from 'twenty-ui/components/input';
+import { useLingui } from '@lingui/react/macro';
const StyledCloseButtonContainer = styled.div`
align-items: center;
@@ -22,6 +22,7 @@ type SpreadSheetImportModalCloseButtonProps = {
export const SpreadSheetImportModalCloseButton = ({
onClose,
}: SpreadSheetImportModalCloseButtonProps) => {
+ const { t } = useLingui();
return (
<StyledCloseButtonContainer>
<IconButton aria-label={t`Close import`} onClick={onClose}>
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalWrapper.tsx b/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalWrapper.tsx
index 6ec2e633b77..92c21bd4b5d 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalWrapper.tsx
+++ b/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalWrapper.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { Dialog } from 'twenty-ui/primitives/surfaces';
import { DialogInstance } from '@/ui/layout/dialog/components/DialogInstance';
import { styled } from '@linaria/react';
@@ -7,6 +6,7 @@ import { useSpreadsheetImportInternal } from '@/spreadsheet-import/hooks/useSpre
import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme';
import { SpreadSheetImportModalCloseButton } from './SpreadSheetImportModalCloseButton';
+import { useLingui } from '@lingui/react/macro';
const StyledPopup = styled(Dialog.Popup)`
height: ${themeCssVariables.modal.size.xl.height};
@@ -44,6 +44,7 @@ export const SpreadSheetImportModalWrapper = ({
children,
onClose,
}: SpreadSheetImportModalWrapperProps) => {
+ const { t } = useLingui();
const { rtl } = useSpreadsheetImportInternal();
return (
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/ImportDataStep.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/ImportDataStep.tsx
index afcb9b0c482..bebe5a695a5 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/ImportDataStep.tsx
+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/ImportDataStep.tsx
@@ -6,8 +6,8 @@ import { spreadsheetImportCreatedRecordsProgressState } from '@/spreadsheet-impo
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { styled } from '@linaria/react';
import { themeCssVariables } from 'twenty-ui/theme';
-import { t } from '@lingui/core/macro';
import { Loader } from 'twenty-ui/primitives/feedback';
+import { useLingui } from '@lingui/react/macro';
const StyledHeader = styled.span`
color: ${themeCssVariables.font.color.primary};
@@ -30,6 +30,7 @@ type ImportDataStepProps = {
export const ImportDataStep = ({
recordsToImportCount,
}: ImportDataStepProps) => {
+ const { t } = useLingui();
const { onClose } = useSpreadsheetImportInternal();
const spreadsheetImportCreatedRecordsProgress = useAtomStateValue(
spreadsheetImportCreatedRecordsProgressState,
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/ColumnGrid.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/ColumnGrid.tsx
index 83a4b9ade53..21ca2f79cb4 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/ColumnGrid.tsx
+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/ColumnGrid.tsx
@@ -1,8 +1,8 @@
import { type SpreadsheetColumns } from '@/spreadsheet-import/types/SpreadsheetColumns';
-import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { themeCssVariables } from 'twenty-ui/theme';
import React from 'react';
+import { useLingui } from '@lingui/react/macro';
const StyledGridContainer = styled.div`
align-items: center;
@@ -96,6 +96,7 @@ export const ColumnGrid = ({
renderTemplateColumn,
renderUnmatchedColumn,
}: ColumnGridProps) => {
+ const { t } = useLingui();
return (
<>
<StyledGridContainer>
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/UserTableColumn.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/UserTableColumn.tsx
index ac0204cf83f..fae2c9553a0 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/UserTableColumn.tsx
+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/UserTableColumn.tsx
@@ -1,11 +1,11 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { themeCssVariables } from 'twenty-ui/theme';
import { type ImportedRow } from '@/spreadsheet-import/types';
import { type SpreadsheetColumn } from '@/spreadsheet-import/types/SpreadsheetColumn';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: flex;
@@ -40,6 +40,7 @@ export const UserTableColumn = ({
column,
importedRow,
}: UserTableColumnProps) => {
+ const { t } = useLingui();
const { header } = column;
const firstDefinedValue = importedRow.find(isDefined);
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/SelectHeaderStep/components/SelectHeaderTable.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/SelectHeaderStep/components/SelectHeaderTable.tsx
index 6c21c70f48d..8bc8330b150 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/SelectHeaderStep/components/SelectHeaderTable.tsx
+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/SelectHeaderStep/components/SelectHeaderTable.tsx
@@ -1,8 +1,7 @@
import { useCallback, useMemo } from 'react';
-import { t } from '@lingui/core/macro';
-
import { SpreadsheetImportSingleSelectTable } from '@/spreadsheet-import/components/SpreadsheetImportSingleSelectTable';
import { type ImportedRow } from '@/spreadsheet-import/types';
+import { useLingui } from '@lingui/react/macro';
type SelectHeaderTableProps = {
importedRows: ImportedRow[];
@@ -15,6 +14,7 @@ export const SelectHeaderTable = ({
selectedRowIndex,
onSelectedRowChange,
}: SelectHeaderTableProps) => {
+ const { t } = useLingui();
const rowKeyGetter = useCallback(
(row: ImportedRow) => importedRows.indexOf(row),
[importedRows],
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/UploadStep/hooks/useDownloadFakeRecords.ts b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/UploadStep/hooks/useDownloadFakeRecords.ts
index 9e780256db2..34f8d52996b 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/UploadStep/hooks/useDownloadFakeRecords.ts
+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/UploadStep/hooks/useDownloadFakeRecords.ts
@@ -7,11 +7,12 @@ import {
formatValueForCSV,
sanitizeValueForCSVExport,
} from 'twenty-shared/utils';
-import { t } from '@lingui/core/macro';
import { saveAs } from 'file-saver';
import { FieldMetadataType } from 'twenty-shared/types';
+import { useLingui } from '@lingui/react/macro';
export const useDownloadFakeRecords = () => {
+ const { t } = useLingui();
const { objectMetadataItem } = useContextStoreObjectMetadataItemOrThrow();
const availableFieldMetadataItems =
diff --git a/packages/twenty-front/src/modules/ui/field/display/components/ArrayDisplay.tsx b/packages/twenty-front/src/modules/ui/field/display/components/ArrayDisplay.tsx
index dc08bda8cc1..267fe1f8444 100644
--- a/packages/twenty-front/src/modules/ui/field/display/components/ArrayDisplay.tsx
+++ b/packages/twenty-front/src/modules/ui/field/display/components/ArrayDisplay.tsx
@@ -1,14 +1,15 @@
import { getChipLabel } from '@/ui/field/display/utils/getChipLabel';
import { type FieldArrayValue } from '@/object-record/record-field/ui/types/FieldMetadata';
import { OverflowingList } from 'twenty-ui/components/layout';
-import { t } from '@lingui/core/macro';
import { Chip } from 'twenty-ui/primitives/data-display';
+import { useLingui } from '@lingui/react/macro';
type ArrayDisplayProps = {
value: FieldArrayValue;
};
export const ArrayDisplay = ({ value }: ArrayDisplayProps) => {
+ const { t } = useLingui();
return (
<OverflowingList overflowLabel={t`Show all items`}>
{value?.map((item, index) => (
diff --git a/packages/twenty-front/src/modules/ui/field/display/components/BooleanDisplay.tsx b/packages/twenty-front/src/modules/ui/field/display/components/BooleanDisplay.tsx
index 25dd65a9142..0460a1d33e5 100644
--- a/packages/twenty-front/src/modules/ui/field/display/components/BooleanDisplay.tsx
+++ b/packages/twenty-front/src/modules/ui/field/display/components/BooleanDisplay.tsx
@@ -1,6 +1,7 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { IconCheck, IconX } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
+
const iconSizeSm = 14;
const StyledBooleanFieldValue = styled.div`
@@ -18,6 +19,7 @@ const StyledContainer = styled.div`
`;
export const BooleanDisplay = ({ value }: BooleanDisplayProps) => {
+ const { t } = useLingui();
if (value === null || value === undefined) {
return <StyledContainer />;
}
diff --git a/packages/twenty-front/src/modules/ui/field/display/components/FileChip.tsx b/packages/twenty-front/src/modules/ui/field/display/components/FileChip.tsx
index 180456f74f8..2704eb9ca66 100644
--- a/packages/twenty-front/src/modules/ui/field/display/components/FileChip.tsx
+++ b/packages/twenty-front/src/modules/ui/field/display/components/FileChip.tsx
@@ -1,10 +1,10 @@
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { FileIcon } from '@/file/components/FileIcon';
import { type FieldFilesValue } from '@/object-record/record-field/ui/types/FieldMetadata';
import { getFieldFilesValueCategory } from '@/object-record/record-field/ui/utils/getFieldFilesValueCategory';
import { Chip } from 'twenty-ui/primitives/data-display';
+import { useLingui } from '@lingui/react/macro';
const MAX_WIDTH = 120;
@@ -19,6 +19,7 @@ export const FileChip = ({
onClick,
forceDisableClick,
}: FileChipProps) => {
+ const { t } = useLingui();
const isDeleted = file.isDeleted === true;
const isClickable = forceDisableClick !== true && !isDeleted;
diff --git a/packages/twenty-front/src/modules/ui/field/display/components/FilePreviewDialog.tsx b/packages/twenty-front/src/modules/ui/field/display/components/FilePreviewDialog.tsx
index 3617790831b..d4d9ce8b5f9 100644
--- a/packages/twenty-front/src/modules/ui/field/display/components/FilePreviewDialog.tsx
+++ b/packages/twenty-front/src/modules/ui/field/display/components/FilePreviewDialog.tsx
@@ -1,12 +1,12 @@
import { DialogInstance } from '@/ui/layout/dialog/components/DialogInstance';
import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { lazy, Suspense, type ReactNode } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconButton } from 'twenty-ui/components/input';
import { IconDownload, IconX } from 'twenty-ui/icon';
import { Dialog } from 'twenty-ui/primitives/surfaces';
+import { useLingui } from '@lingui/react/macro';
const DocumentViewer = lazy(() =>
import('@/activities/files/components/DocumentViewer').then((module) => ({
@@ -75,52 +75,55 @@ export const FilePreviewDialog = ({
onDownload,
downloadLabel,
loadingFallback,
-}: FilePreviewDialogProps) => (
- <DialogInstance
- dialogId={dialogId}
- dismissible
- onClose={onClose}
- renderInDocumentBody
- >
- {({ onKeyDown }) => (
- <Dialog.Popup onKeyDown={onKeyDown} size="lg">
- <StyledPreviewLayout>
- <StyledHeader>
- <Dialog.Title size="md" render={<StyledTitle />}>
- {title}
- </Dialog.Title>
- <StyledActions>
- {isDefined(onDownload) && (
+}: FilePreviewDialogProps) => {
+ const { t } = useLingui();
+ return (
+ <DialogInstance
+ dialogId={dialogId}
+ dismissible
+ onClose={onClose}
+ renderInDocumentBody
+ >
+ {({ onKeyDown }) => (
+ <Dialog.Popup onKeyDown={onKeyDown} size="lg">
+ <StyledPreviewLayout>
+ <StyledHeader>
+ <Dialog.Title size="md" render={<StyledTitle />}>
+ {title}
+ </Dialog.Title>
+ <StyledActions>
+ {isDefined(onDownload) && (
+ <IconButton
+ aria-label={downloadLabel}
+ onClick={onDownload}
+ size="sm"
+ >
+ <IconDownload />
+ </IconButton>
+ )}
<IconButton
- aria-label={downloadLabel}
- onClick={onDownload}
+ aria-label={t`Close preview`}
+ onClick={onClose}
size="sm"
>
- <IconDownload />
+ <IconX />
</IconButton>
- )}
- <IconButton
- aria-label={t`Close preview`}
- onClick={onClose}
- size="sm"
- >
- <IconX />
- </IconButton>
- </StyledActions>
- </StyledHeader>
- <ScrollWrapper componentInstanceId={scrollWrapperId}>
- <StyledPreviewContent>
- <Suspense fallback={loadingFallback}>
- <DocumentViewer
- documentName={documentName}
- documentUrl={documentUrl}
- documentExtension={documentExtension}
- />
- </Suspense>
- </StyledPreviewContent>
- </ScrollWrapper>
- </StyledPreviewLayout>
- </Dialog.Popup>
- )}
- </DialogInstance>
-);
+ </StyledActions>
+ </StyledHeader>
+ <ScrollWrapper componentInstanceId={scrollWrapperId}>
+ <StyledPreviewContent>
+ <Suspense fallback={loadingFallback}>
+ <DocumentViewer
+ documentName={documentName}
+ documentUrl={documentUrl}
+ documentExtension={documentExtension}
+ />
+ </Suspense>
+ </StyledPreviewContent>
+ </ScrollWrapper>
+ </StyledPreviewLayout>
+ </Dialog.Popup>
+ )}
+ </DialogInstance>
+ );
+};
diff --git a/packages/twenty-front/src/modules/ui/field/display/components/internal/AvatarOrIcon/AvatarOrIcon.tsx b/packages/twenty-front/src/modules/ui/field/display/components/internal/AvatarOrIcon/AvatarOrIcon.tsx
index 3cd24d37999..52130d84729 100644
--- a/packages/twenty-front/src/modules/ui/field/display/components/internal/AvatarOrIcon/AvatarOrIcon.tsx
+++ b/packages/twenty-front/src/modules/ui/field/display/components/internal/AvatarOrIcon/AvatarOrIcon.tsx
@@ -1,5 +1,4 @@
import { getAvatarButtonRender } from '@/ui/field/display/utils/getAvatarButtonRender';
-import { t } from '@lingui/core/macro';
import { css } from '@linaria/core';
import { isNonEmptyString } from '@sniptt/guards';
@@ -7,6 +6,7 @@ import { Avatar } from 'twenty-ui/primitives/data-display';
import { useTheme } from 'twenty-ui/theme';
import { type AvatarOrIconProps } from './types/AvatarOrIconProps';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
const styles = {
iconWithBackgroundContainer: css`
@@ -59,6 +59,7 @@ export const AvatarOrIcon = ({
IconBackgroundColor,
onClick,
}: AvatarOrIconProps) => {
+ const { t } = useLingui();
const theme = useTheme();
if (!isDefined(Icon)) {
diff --git a/packages/twenty-front/src/modules/ui/field/input/components/AddressInput.tsx b/packages/twenty-front/src/modules/ui/field/input/components/AddressInput.tsx
index b7074947baa..6340a1eef53 100644
--- a/packages/twenty-front/src/modules/ui/field/input/components/AddressInput.tsx
+++ b/packages/twenty-front/src/modules/ui/field/input/components/AddressInput.tsx
@@ -18,12 +18,11 @@ import { StyledFieldInputDetails } from '@/ui/field/input/components/StyledField
import { StyledTextInput } from '@/ui/field/input/components/TextInput';
import { Autocomplete } from 'twenty-ui/primitives/input';
import { MOBILE_VIEWPORT } from 'twenty-ui/theme';
-
-import { t } from '@lingui/core/macro';
import { type AllowedAddressSubField } from 'twenty-shared/types';
import { useAddressAutocomplete } from '@/ui/field/input/hooks/useAddressAutocomplete';
import { useAddressInputClickOutside } from '@/ui/field/input/hooks/useAddressInputClickOutside';
import { useFocusManagement } from '@/ui/field/input/hooks/useFocusManagement';
+import { useLingui } from '@lingui/react/macro';
const StyledAddressContainer = styled.div`
display: flex;
@@ -54,6 +53,7 @@ export const AddressInput = ({
onChange,
subFields,
}: AddressInputProps) => {
+ const { t } = useLingui();
const store = useStore();
const [internalValueAtom] = useState(() =>
atom<FieldAddressDraftValue>(value),
diff --git a/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx b/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx
index aec8ad0775a..17daa10366b 100644
--- a/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx
+++ b/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx
@@ -2,7 +2,6 @@ import { type FieldMultiSelectValue } from '@/object-record/record-field/ui/type
import { AddSelectOptionDropdownSection } from '@/ui/input/components/AddSelectOptionDropdownSection';
import { filterSelectOptionsBySearch } from '@/ui/input/utils/filterSelectOptionsBySearch';
import { isKeyboardEventComposing } from '@/ui/utilities/hotkey/utils/isKeyboardEventComposing';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { createElement, useState } from 'react';
import { Key } from 'ts-key-enum';
@@ -11,6 +10,7 @@ import { Dropdown } from 'twenty-ui/components/navigation';
import { Tag } from 'twenty-ui/primitives/data-display';
import { type SelectOption } from 'twenty-ui/primitives/input';
import { turnIntoEmptyStringIfWhitespacesOnly } from '~/utils/string/turnIntoEmptyStringIfWhitespacesOnly';
+import { useLingui } from '@lingui/react/macro';
type MultiSelectInputProps = {
values: FieldMultiSelectValue;
@@ -27,6 +27,7 @@ export const MultiSelectInput = ({
onAddSelectOption,
onEnter,
}: MultiSelectInputProps) => {
+ const { t } = useLingui();
const [searchFilter, setSearchFilter] = useState('');
const filteredOptions = filterSelectOptionsBySearch({
options,
diff --git a/packages/twenty-front/src/modules/ui/field/input/components/RatingInput.tsx b/packages/twenty-front/src/modules/ui/field/input/components/RatingInput.tsx
index 3cf743810e1..0c20acec5b1 100644
--- a/packages/twenty-front/src/modules/ui/field/input/components/RatingInput.tsx
+++ b/packages/twenty-front/src/modules/ui/field/input/components/RatingInput.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { useState } from 'react';
@@ -7,6 +6,7 @@ import { RATING_VALUES } from 'twenty-shared/constants';
import { type FieldRatingValue } from 'twenty-shared/types';
import { IconTwentyStarFilled } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
align-items: center;
@@ -31,6 +31,7 @@ export const RatingInput = ({
value,
readonly,
}: RatingInputProps) => {
+ const { t } = useLingui();
const clearField = useClearField();
const theme = useTheme();
diff --git a/packages/twenty-front/src/modules/ui/input/components/AddSelectOptionDropdownSection.tsx b/packages/twenty-front/src/modules/ui/input/components/AddSelectOptionDropdownSection.tsx
index 099aa5e5287..4dc82cf2a9d 100644
--- a/packages/twenty-front/src/modules/ui/input/components/AddSelectOptionDropdownSection.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/AddSelectOptionDropdownSection.tsx
@@ -1,9 +1,9 @@
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
import { IconPlus } from 'twenty-ui/icon';
import { type SelectOption } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
type AddSelectOptionDropdownSectionProps = {
searchFilter: string;
@@ -16,6 +16,7 @@ export const AddSelectOptionDropdownSection = ({
filteredOptions,
onAddSelectOption,
}: AddSelectOptionDropdownSectionProps) => {
+ const { t } = useLingui();
const optionName = searchFilter.trim();
if (
diff --git a/packages/twenty-front/src/modules/ui/input/components/BaseChip.tsx b/packages/twenty-front/src/modules/ui/input/components/BaseChip.tsx
index 20b11603363..83ec1251ac9 100644
--- a/packages/twenty-front/src/modules/ui/input/components/BaseChip.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/BaseChip.tsx
@@ -1,8 +1,8 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type MouseEvent, type ReactNode } from 'react';
import { IconX } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledChip = styled.div<{
deletable: boolean;
@@ -121,6 +121,7 @@ export const BaseChip = ({
maxWidth,
leftIcon,
}: BaseChipProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const isDeletable = onRemove !== undefined;
diff --git a/packages/twenty-front/src/modules/ui/input/components/IconPicker.tsx b/packages/twenty-front/src/modules/ui/input/components/IconPicker.tsx
index 385a8bc8a64..5d4b8b4cfec 100644
--- a/packages/twenty-front/src/modules/ui/input/components/IconPicker.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/IconPicker.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { type ReactElement, useMemo, useRef, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -25,6 +24,7 @@ import { getIconPickerSearchScore } from '@/ui/input/utils/getIconPickerSearchSc
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { useAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyState';
+import { useLingui } from '@lingui/react/macro';
type IconPickerProps = {
disabled?: boolean;
@@ -86,6 +86,7 @@ export const IconPicker = ({
iconColorPicker,
iconColor,
}: IconPickerProps) => {
+ const { t } = useLingui();
const [searchString, setSearchString] = useState('');
const [visibleCount, setVisibleCount] = useAtomFamilyState(
iconPickerVisibleCountState,
diff --git a/packages/twenty-front/src/modules/ui/input/components/Select.tsx b/packages/twenty-front/src/modules/ui/input/components/Select.tsx
index f9e0a27d305..f3efd1a6b71 100644
--- a/packages/twenty-front/src/modules/ui/input/components/Select.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/Select.tsx
@@ -5,7 +5,6 @@ import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { hasFullFormFieldBorder } from '@/ui/input/utils/hasFullFormFieldBorder';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useMemo, useRef, useState } from 'react';
import { Dropdown } from 'twenty-ui/components/navigation';
import { Tag } from 'twenty-ui/primitives/data-display';
@@ -19,6 +18,7 @@ import { isNonEmptyArray, isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
import { normalizeSearchText } from 'twenty-ui/utilities';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div<{ fullWidth?: boolean }>`
width: ${({ fullWidth }) => (fullWidth ? '100%' : 'auto')};
@@ -67,6 +67,7 @@ export const Select = <TValue extends SelectValue>({
variant = 'default',
renderAsTag = false,
}: SelectProps<TValue>) => {
+ const { t } = useLingui();
const dropdownContentRef = useRef<HTMLDivElement>(null);
const [searchInputValue, setSearchInputValue] = useState('');
diff --git a/packages/twenty-front/src/modules/ui/input/components/SelectInput.tsx b/packages/twenty-front/src/modules/ui/input/components/SelectInput.tsx
index b27a33ee263..dc2cf19353b 100644
--- a/packages/twenty-front/src/modules/ui/input/components/SelectInput.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/SelectInput.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { createElement, useState } from 'react';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
@@ -8,6 +7,7 @@ import { type SelectOption } from 'twenty-ui/primitives/input';
import { AddSelectOptionDropdownSection } from '@/ui/input/components/AddSelectOptionDropdownSection';
import { filterSelectOptionsBySearch } from '@/ui/input/utils/filterSelectOptionsBySearch';
import { normalizeSearchText } from 'twenty-ui/utilities';
+import { useLingui } from '@lingui/react/macro';
type SelectInputProps = {
onOptionSelected: (selectedOption: SelectOption) => void;
@@ -26,6 +26,7 @@ export const SelectInput = ({
value,
onAddSelectOption,
}: SelectInputProps) => {
+ const { t } = useLingui();
const [searchFilter, setSearchFilter] = useState('');
const isSearching = isNonEmptyString(searchFilter.trim());
const filteredOptions = filterSelectOptionsBySearch({
diff --git a/packages/twenty-front/src/modules/ui/input/components/ThemeColorPickerMenu.tsx b/packages/twenty-front/src/modules/ui/input/components/ThemeColorPickerMenu.tsx
index fc1a0c64dc5..4939279baab 100644
--- a/packages/twenty-front/src/modules/ui/input/components/ThemeColorPickerMenu.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/ThemeColorPickerMenu.tsx
@@ -1,11 +1,11 @@
import { useColorLabels } from '@/ui/input/hooks/useColorLabels';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { Dropdown } from 'twenty-ui/components/navigation';
import { ColorSample } from 'twenty-ui/primitives/data-display';
import { type ThemeColor, MAIN_COLOR_NAMES } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type ThemeColorPickerMenuProps = {
selectedColor: ThemeColor;
@@ -16,6 +16,7 @@ export const ThemeColorPickerMenu = ({
selectedColor,
onSelectColor,
}: ThemeColorPickerMenuProps) => {
+ const { t } = useLingui();
const colorLabels = useColorLabels();
const [searchValue, setSearchValue] = useState('');
const query = searchValue.trim().toLowerCase();
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/country/components/CountrySelect.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/country/components/CountrySelect.tsx
index cb328f0ce5a..bd1d5db5453 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/country/components/CountrySelect.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/country/components/CountrySelect.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { useContext, useMemo } from 'react';
import { Key } from 'ts-key-enum';
@@ -17,6 +16,7 @@ import {
type CountryChoice,
CountrySelect as SharedCountrySelect,
} from 'twenty-ui/components/input';
+import { useLingui } from '@lingui/react/macro';
type CountrySelectProps = {
label: string;
@@ -31,6 +31,7 @@ export const CountrySelect = ({
onChange,
dropdownId = SELECT_COUNTRY_DROPDOWN_ID,
}: CountrySelectProps) => {
+ const { t } = useLingui();
const countries = useCountries();
const parentClickOutsideId = useContext(ParentClickOutsideIdContext);
const isDropdownOpen = useAtomComponentStateValue(
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownButton.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownButton.tsx
index 3d37af7aa6c..f9e0df8f8dd 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownButton.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownButton.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { type KeyboardEvent, useId } from 'react';
import { CurrencyCode } from 'twenty-shared/constants';
import { isDefined } from 'twenty-shared/utils';
@@ -7,6 +6,7 @@ import { CurrencyPicker } from 'twenty-ui/components/input';
import { useCurrencyPickerCurrencies } from '@/ui/input/components/internal/currency/hooks/useCurrencyPickerCurrencies';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
+import { useLingui } from '@lingui/react/macro';
type CurrencyPickerDropdownButtonProps = {
selectedCurrencyCode: string;
@@ -29,6 +29,7 @@ export const CurrencyPickerDropdownButton = ({
onChange,
disabled,
}: CurrencyPickerDropdownButtonProps) => {
+ const { t } = useLingui();
const dropdownId = useId();
const currencyPickerCurrencies = useCurrencyPickerCurrencies();
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerCalendar.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerCalendar.tsx
index 829eb43e5b2..c5aabd16d79 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerCalendar.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerCalendar.tsx
@@ -1,12 +1,12 @@
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { getDatePickerWeekStartOrThrow } from '@/ui/input/components/internal/date/utils/getDatePickerWeekStartOrThrow';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { Temporal } from 'temporal-polyfill';
import { SOURCE_LOCALE } from 'twenty-shared/translations';
import { isDefined } from 'twenty-shared/utils';
import { DatePicker, type DatePickerProps } from 'twenty-ui/components/input';
+import { useLingui } from '@lingui/react/macro';
type DatePickerCalendarProps = {
value: string | null;
@@ -35,6 +35,7 @@ export const DatePickerCalendar = ({
renderHeader,
loadingFallback,
}: DatePickerCalendarProps) => {
+ const { t } = useLingui();
const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
const currentToday = today ?? Temporal.Now.plainDateISO().toString();
const referenceDate = highlightedRange?.start ?? value ?? currentToday;
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerClearButton.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerClearButton.tsx
index b746df69901..f9bad427692 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerClearButton.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerClearButton.tsx
@@ -1,8 +1,8 @@
-import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { IconCalendarX } from 'twenty-ui/icon';
import { Text } from 'twenty-ui/primitives/typography';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledSeparator = styled.div`
border-bottom: 1px solid ${themeCssVariables.border.color.light};
@@ -41,6 +41,7 @@ type DatePickerClearButtonProps = {
export const DatePickerClearButton = ({
onClear,
}: DatePickerClearButtonProps) => {
+ const { t } = useLingui();
const theme = useTheme();
return (
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerHeader.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerHeader.tsx
index 03e8c8181cf..7b1f6acdee3 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerHeader.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerHeader.tsx
@@ -1,6 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
import { Select } from '@/ui/input/components/Select';
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
@@ -15,6 +13,7 @@ import { isDefined } from 'twenty-shared/utils';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconChevronLeft, IconChevronRight } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledCustomDatePickerHeader = styled.div`
align-items: center;
@@ -54,6 +53,7 @@ export const DatePickerHeader = ({
nextMonthButtonDisabled,
hideInput = false,
}: DatePickerHeaderProps) => {
+ const { t } = useLingui();
const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
const userLocale = currentWorkspaceMember?.locale ?? SOURCE_LOCALE;
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DateTimePickerHeader.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DateTimePickerHeader.tsx
index 7ff1a623ad4..9cfb022073e 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DateTimePickerHeader.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DateTimePickerHeader.tsx
@@ -15,7 +15,6 @@ import { getTimeBlocks } from '@/ui/input/components/internal/date/utils/getTime
import { getTimeMask } from '@/ui/input/components/internal/date/utils/getTimeMask';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
-import { t } from '@lingui/core/macro';
import { Temporal } from 'temporal-polyfill';
import { SOURCE_LOCALE } from 'twenty-shared/translations';
import { isDefined } from 'twenty-shared/utils';
@@ -30,6 +29,7 @@ import {
IconClock,
} from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const TIME_INPUT_ICON_SIZE = 16;
@@ -100,6 +100,7 @@ export const DateTimePickerHeader = ({
onChangeMonth,
onChangeYear,
}: DateTimePickerHeaderProps) => {
+ const { t } = useLingui();
const { timeFormat } = useDateTimeFormat();
const { formatTime, parseTime, isHour12 } = useTimeInput(timeFormat);
const displayedMonth = Temporal.PlainYearMonth.from(viewedMonth);
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/RelativeDatePickerCalendarNavigation.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/RelativeDatePickerCalendarNavigation.tsx
index 90514d1ce6c..2f31a98cc9e 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/RelativeDatePickerCalendarNavigation.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/RelativeDatePickerCalendarNavigation.tsx
@@ -1,11 +1,11 @@
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { SOURCE_LOCALE } from 'twenty-shared/translations';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconChevronLeft, IconChevronRight } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
align-items: center;
@@ -36,6 +36,7 @@ export const RelativeDatePickerCalendarNavigation = ({
prevMonthButtonDisabled,
nextMonthButtonDisabled,
}: RelativeDatePickerCalendarNavigationProps) => {
+ const { t } = useLingui();
const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
const userLocale = currentWorkspaceMember?.locale ?? SOURCE_LOCALE;
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/RelativeDatePickerHeader.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/RelativeDatePickerHeader.tsx
index 681ef13f3ca..2a85ab5435a 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/RelativeDatePickerHeader.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/RelativeDatePickerHeader.tsx
@@ -5,7 +5,7 @@ import { RELATIVE_DATE_DIRECTION_SELECT_OPTIONS } from '@/ui/input/components/in
import { RELATIVE_DATETIME_UNITS } from '@/ui/input/components/internal/date/constants/RelativeDateTimeUnits';
import { RELATIVE_DATE_UNITS } from '@/ui/input/components/internal/date/constants/RelativeDateUnits';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { useState } from 'react';
import { type Nullable } from 'twenty-shared/types';
@@ -18,6 +18,7 @@ import {
type RelativeDateFilterUnit,
} from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div<{ noPadding: boolean }>`
display: flex;
@@ -67,6 +68,7 @@ export const RelativeDatePickerHeader = ({
prevMonthButtonDisabled,
nextMonthButtonDisabled,
}: RelativeDatePickerHeaderProps) => {
+ const { t } = useLingui();
const amountString = amount?.toString() ?? '';
const amountTextValue = direction === 'THIS' ? '' : amountString;
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownButton.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownButton.tsx
index 923f27b6a00..9de989d4171 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownButton.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownButton.tsx
@@ -1,10 +1,10 @@
-import { t } from '@lingui/core/macro';
import { type KeyboardEvent, useId, useMemo } from 'react';
import { PhoneCountryPicker } from 'twenty-ui/components/input';
import { useCountries } from '@/ui/input/components/internal/hooks/useCountries';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
+import { useLingui } from '@lingui/react/macro';
type PhoneCountryPickerDropdownButtonProps = {
value?: string;
@@ -29,6 +29,7 @@ export const PhoneCountryPickerDropdownButton = ({
disabled,
readOnly,
}: PhoneCountryPickerDropdownButtonProps) => {
+ const { t } = useLingui();
const dropdownId = useId();
const availableCountries = useCountries();
const countries = useMemo(
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent.tsx
index b4da29d11d7..865fe695b22 100644
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type MouseEvent, type ReactElement } from 'react';
import { LightIconButton } from 'twenty-ui/components/input';
import { type IconComponent } from 'twenty-ui/icon';
@@ -8,6 +7,7 @@ import {
type AvatarProps,
} from 'twenty-ui/primitives/data-display';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledNonClickableStartIcon = styled.div`
align-items: center;
@@ -41,6 +41,7 @@ export const DropdownMenuHeaderLeftComponent = ({
}
| Record<never, never>
)) => {
+ const { t } = useLingui();
const theme = useTheme();
return (
<>
diff --git a/packages/twenty-front/src/modules/ui/layout/page/components/PageHeader.tsx b/packages/twenty-front/src/modules/ui/layout/page/components/PageHeader.tsx
index 4db774e1b24..21891c5279f 100644
--- a/packages/twenty-front/src/modules/ui/layout/page/components/PageHeader.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/page/components/PageHeader.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { MediaAccessIndicator } from '@/media-access/components/MediaAccessIndicator';
@@ -16,6 +15,7 @@ import { LightIconButton } from 'twenty-ui/components/input';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { type IconComponent, IconX } from 'twenty-ui/icon';
import { MOBILE_VIEWPORT, useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledTopBarContainer = styled.div<{ isMobile: boolean }>`
align-items: center;
@@ -99,6 +99,7 @@ export const PageHeader = ({
children,
className,
}: PageHeaderProps) => {
+ const { t } = useLingui();
const isMobile = useIsMobile();
const isSettingsPage = useIsSettingsPage();
const theme = useTheme();
diff --git a/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabMoreButton.tsx b/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabMoreButton.tsx
index c1d71e8f639..b040961ac3b 100644
--- a/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabMoreButton.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabMoreButton.tsx
@@ -1,10 +1,10 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { IconChevronDown } from 'twenty-ui/icon';
import { Dropdown, TabButton } from 'twenty-ui/components/navigation';
import { TAB_LIST_HEIGHT } from '@/ui/layout/tab-list/constants/TabListHeight';
import { TAB_LIST_ROW_HEIGHT_CSS_VARIABLE } from '@/ui/layout/tab-list/constants/TabListRowHeightCssVariable';
+import { useLingui } from '@lingui/react/macro';
const TAB_MORE_BUTTON_TEST_ID = 'tab-tab-more-button';
@@ -26,6 +26,7 @@ export const TabMoreButton = ({
disableTestId,
isDropdownTrigger = false,
}: TabMoreButtonProps) => {
+ const { t } = useLingui();
const testId = disableTestId ? undefined : TAB_MORE_BUTTON_TEST_ID;
const tabButton = (
diff --git a/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/Breadcrumb.tsx b/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/Breadcrumb.tsx
index 5a079e0fd16..b2b4d447403 100644
--- a/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/Breadcrumb.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/Breadcrumb.tsx
@@ -1,12 +1,13 @@
import { MobileBreadcrumb } from '@/ui/navigation/bread-crumb/components/MobileBreadcrumb';
import { type BreadcrumbProps } from '@/ui/navigation/bread-crumb/types/BreadcrumbProps';
import { getBreadcrumbItems } from '@/ui/navigation/bread-crumb/utils/getBreadcrumbItems';
-import { t } from '@lingui/core/macro';
import { isNonEmptyArray } from 'twenty-shared/utils';
import { Breadcrumb as BreadcrumbPrimitive } from 'twenty-ui/primitives/navigation';
import { useIsMobile } from 'twenty-ui/utilities';
+import { useLingui } from '@lingui/react/macro';
export const Breadcrumb = ({ links }: BreadcrumbProps) => {
+ const { t } = useLingui();
const isMobile = useIsMobile();
if (isMobile && isNonEmptyArray(links)) {
diff --git a/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/MobileBreadcrumb.tsx b/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/MobileBreadcrumb.tsx
index 649bea959c9..b238e41627c 100644
--- a/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/MobileBreadcrumb.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/MobileBreadcrumb.tsx
@@ -1,8 +1,7 @@
import { useIsSettingsPage } from '@/navigation/hooks/useIsSettingsPage';
import { type BreadcrumbProps } from '@/ui/navigation/bread-crumb/types/BreadcrumbProps';
import { getBreadcrumbItems } from '@/ui/navigation/bread-crumb/utils/getBreadcrumbItems';
-import { t } from '@lingui/core/macro';
-import { Trans } from '@lingui/react/macro';
+import { Trans, useLingui } from '@lingui/react/macro';
import { styled } from '@linaria/react';
import { isNonEmptyString } from '@sniptt/guards';
import { Link } from 'react-router-dom';
@@ -51,6 +50,7 @@ const StyledText = styled.span`
`;
export const MobileBreadcrumb = ({ links }: MobileBreadcrumbProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const isSettingsPage = useIsSettingsPage();
diff --git a/packages/twenty-front/src/modules/ui/navigation/menu-item/components/MenuItemWithOptionDropdown.tsx b/packages/twenty-front/src/modules/ui/navigation/menu-item/components/MenuItemWithOptionDropdown.tsx
index 8babcfdb81e..b2aeefa95fd 100644
--- a/packages/twenty-front/src/modules/ui/navigation/menu-item/components/MenuItemWithOptionDropdown.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/menu-item/components/MenuItemWithOptionDropdown.tsx
@@ -3,7 +3,6 @@ import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { isDropdownOpenComponentState } from '@/ui/layout/dropdown/states/isDropdownOpenComponentState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type MouseEvent } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { LightIconButton } from 'twenty-ui/components/input';
@@ -12,6 +11,7 @@ import { IconDotsVertical } from 'twenty-ui/icon';
import { ListItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables, useTheme } from 'twenty-ui/theme';
import { type MenuItemWithOptionDropdownProps } from './types/MenuItemWithOptionDropdownProps';
+import { useLingui } from '@lingui/react/macro';
const StyledMenuItemContainer = styled.div<{
focused: boolean;
@@ -76,6 +76,7 @@ export const MenuItemWithOptionDropdown = ({
dropdownAlign = 'end',
selected = false,
}: MenuItemWithOptionDropdownProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const isDropdownOpen = useAtomComponentStateValue(
isDropdownOpenComponentState,
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerItem.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerItem.tsx
index e7af3ad363b..714825b24dd 100644
--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerItem.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerItem.tsx
@@ -16,7 +16,6 @@ import { useMouseDownNavigation } from '@/ui/navigation/hooks/useMouseDownNaviga
import { useIsMobile } from 'twenty-ui/utilities';
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { Link } from 'react-router-dom';
import { isAbsoluteUrl, isDefined } from 'twenty-shared/utils';
@@ -29,6 +28,8 @@ import {
} from 'twenty-ui/primitives/typography';
import { MOBILE_VIEWPORT, useTheme, themeCssVariables } from 'twenty-ui/theme';
import { openUrlInNewTab } from '~/utils/openUrlInNewTab';
+import { useLingui } from '@lingui/react/macro';
+
const DEFAULT_INDENTATION_LEVEL = 1;
const INTERACTIVE_OPTIONS_SELECTOR = doNotTranslate(
'button, a, [role="button"]',
@@ -240,6 +241,7 @@ export const NavigationDrawerItem = ({
variant = 'default',
isUnread = false,
}: NavigationDrawerItemProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const accessibleKeyLabels = useShortcutAccessibleKeyLabels();
const editingContent = useContext(NavigationDrawerItemEditingContext);
diff --git a/packages/twenty-front/src/modules/ui/suggestion/components/SuggestionMenu.tsx b/packages/twenty-front/src/modules/ui/suggestion/components/SuggestionMenu.tsx
index 5240950d411..afa331959e8 100644
--- a/packages/twenty-front/src/modules/ui/suggestion/components/SuggestionMenu.tsx
+++ b/packages/twenty-front/src/modules/ui/suggestion/components/SuggestionMenu.tsx
@@ -6,7 +6,6 @@ import {
useFloating,
} from '@floating-ui/react';
import { motion } from 'framer-motion';
-import { t } from '@lingui/core/macro';
import {
forwardRef,
useId,
@@ -29,6 +28,7 @@ import { getSuggestionMenuItemAnchorId } from '@/ui/suggestion/utils/getSuggesti
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
import { useIsMobile } from 'twenty-ui/utilities';
+import { useLingui } from '@lingui/react/macro';
type SuggestionMenuInnerProps<TItem> = SuggestionMenuProps<TItem>;
@@ -37,6 +37,7 @@ const SuggestionMenuInner = <TItem,>(
props: SuggestionMenuInnerProps<TItem>,
parentRef: React.ForwardedRef<unknown>,
) => {
+ const { t } = useLingui();
const {
items,
onSelect,
diff --git a/packages/twenty-front/src/modules/views/components/UpdateViewButtonGroup.tsx b/packages/twenty-front/src/modules/views/components/UpdateViewButtonGroup.tsx
index 5bea156e387..722be904197 100644
--- a/packages/twenty-front/src/modules/views/components/UpdateViewButtonGroup.tsx
+++ b/packages/twenty-front/src/modules/views/components/UpdateViewButtonGroup.tsx
@@ -22,11 +22,11 @@ import { useSaveCurrentViewFiltersAndSorts } from '@/views/hooks/useSaveCurrentV
import { getViewPickerDropdownId } from '@/views/view-picker/utils/getViewPickerDropdownId';
import { useViewPickerMode } from '@/views/view-picker/hooks/useViewPickerMode';
import { viewPickerReferenceViewIdComponentState } from '@/views/view-picker/states/viewPickerReferenceViewIdComponentState';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronDown, IconPlus } from 'twenty-ui/icon';
import { Button, ButtonGroup } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: inline-flex;
@@ -35,6 +35,7 @@ const StyledContainer = styled.div`
`;
export const UpdateViewButtonGroup = () => {
+ const { t } = useLingui();
const { saveCurrentViewFilterAndSorts } = useSaveCurrentViewFiltersAndSorts();
const { canPersistChanges } = useCanPersistViewChanges();
diff --git a/packages/twenty-front/src/modules/views/components/ViewBarDetails.tsx b/packages/twenty-front/src/modules/views/components/ViewBarDetails.tsx
index d631bef3197..04b816cf9cb 100644
--- a/packages/twenty-front/src/modules/views/components/ViewBarDetails.tsx
+++ b/packages/twenty-front/src/modules/views/components/ViewBarDetails.tsx
@@ -33,11 +33,11 @@ import { useApplyCurrentViewFilterGroupsToCurrentRecordFilterGroups } from '@/vi
import { useAreViewFilterGroupsDifferentFromRecordFilterGroups } from '@/views/hooks/useAreViewFilterGroupsDifferentFromRecordFilterGroups';
import { useIsViewAnyFieldFilterDifferentFromCurrentAnyFieldFilter } from '@/views/hooks/useIsViewAnyFieldFilterDifferentFromCurrentAnyFieldFilter';
import { isViewBarExpandedComponentState } from '@/views/states/isViewBarExpandedComponentState';
-import { t } from '@lingui/core/macro';
import { isNonEmptyArray, isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { LightButton } from 'twenty-ui/components/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
export type ViewBarDetailsProps = {
hasFilterButton?: boolean;
@@ -106,6 +106,7 @@ export const ViewBarDetails = ({
viewBarId,
objectNamePlural,
}: ViewBarDetailsProps) => {
+ const { t } = useLingui();
const { recordIndexId } = useRecordIndexContextOrThrow();
const isViewBarExpanded = useAtomComponentStateValue(
diff --git a/packages/twenty-front/src/modules/views/components/ViewBarDetailsAddFilterButton.tsx b/packages/twenty-front/src/modules/views/components/ViewBarDetailsAddFilterButton.tsx
index f510e5a6470..b22be90f346 100644
--- a/packages/twenty-front/src/modules/views/components/ViewBarDetailsAddFilterButton.tsx
+++ b/packages/twenty-front/src/modules/views/components/ViewBarDetailsAddFilterButton.tsx
@@ -3,11 +3,12 @@ import { getViewBarFilterDropdownId } from '@/views/utils/getViewBarFilterDropdo
import { useResetFilterDropdown } from '@/object-record/object-filter-dropdown/hooks/useResetFilterDropdown';
import { useToggleDropdown } from '@/ui/layout/dropdown/hooks/useToggleDropdown';
-import { t } from '@lingui/core/macro';
import { LightButton } from 'twenty-ui/components/input';
import { IconPlus } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const ViewBarDetailsAddFilterButton = () => {
+ const { t } = useLingui();
const { toggleDropdown } = useToggleDropdown();
const { recordIndexId } = useRecordIndexContextOrThrow();
const filterDropdownId = getViewBarFilterDropdownId(recordIndexId);
diff --git a/packages/twenty-front/src/modules/views/components/ViewFieldsHiddenDropdownSection.tsx b/packages/twenty-front/src/modules/views/components/ViewFieldsHiddenDropdownSection.tsx
index 4ff5a9d4548..357c6f916da 100644
--- a/packages/twenty-front/src/modules/views/components/ViewFieldsHiddenDropdownSection.tsx
+++ b/packages/twenty-front/src/modules/views/components/ViewFieldsHiddenDropdownSection.tsx
@@ -7,14 +7,15 @@ import { currentRecordFieldsComponentState } from '@/object-record/record-field/
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { ViewType } from '@/views/types/ViewType';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconEye } from 'twenty-ui/icon';
import { useIcons } from 'twenty-ui/icon/provider';
import { ListItem } from 'twenty-ui/primitives/navigation';
+import { useLingui } from '@lingui/react/macro';
export const ViewFieldsHiddenDropdownSection = () => {
+ const { t } = useLingui();
const { viewType, objectMetadataItem, recordIndexId } = useContext(
ObjectOptionsDropdownContext,
);
diff --git a/packages/twenty-front/src/modules/views/components/ViewFieldsVisibleDropdownSection.tsx b/packages/twenty-front/src/modules/views/components/ViewFieldsVisibleDropdownSection.tsx
index e04586810e8..be76fae3532 100644
--- a/packages/twenty-front/src/modules/views/components/ViewFieldsVisibleDropdownSection.tsx
+++ b/packages/twenty-front/src/modules/views/components/ViewFieldsVisibleDropdownSection.tsx
@@ -13,15 +13,16 @@ import { type DraggableListDropResult } from '@/ui/layout/draggable-list/types/D
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
import { ViewType } from '@/views/types/ViewType';
-import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconEyeOff } from 'twenty-ui/icon';
import { useIcons } from 'twenty-ui/icon/provider';
import { sortByProperty } from '~/utils/array/sortByProperty';
+import { useLingui } from '@lingui/react/macro';
export const ViewFieldsVisibleDropdownSection = () => {
+ const { t } = useLingui();
const { viewType, objectMetadataItem, recordIndexId } = useContext(
ObjectOptionsDropdownContext,
);
diff --git a/packages/twenty-front/src/modules/views/hooks/useComputeRecordRelationFilterDisplayValue.tsx b/packages/twenty-front/src/modules/views/hooks/useComputeRecordRelationFilterDisplayValue.tsx
index 668af8ccece..cf23839a41c 100644
--- a/packages/twenty-front/src/modules/views/hooks/useComputeRecordRelationFilterDisplayValue.tsx
+++ b/packages/twenty-front/src/modules/views/hooks/useComputeRecordRelationFilterDisplayValue.tsx
@@ -7,8 +7,6 @@ import { useCombinedFindManyRecords } from '@/object-record/multiple-objects/hoo
import { getTargetObjectMetadataIdsFromField } from '@/object-record/record-field/ui/utils/junction/getTargetObjectMetadataIdsFromField';
import { type RecordFilter } from '@/object-record/record-filter/types/RecordFilter';
import { computeRelationFilterDisplayValue } from '@/views/utils/computeRelationFilterDisplayValue';
-
-import { t } from '@lingui/core/macro';
import { type RecordGqlOperationSignature } from 'twenty-shared/types';
import {
arrayOfUuidOrVariableSchema,
@@ -17,6 +15,7 @@ import {
jsonRelationFilterValueSchema,
} from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
type UseComputeRecordRelationFilterDisplayValueParams = {
recordFilter: RecordFilter;
@@ -26,6 +25,7 @@ type UseComputeRecordRelationFilterDisplayValueParams = {
export const useComputeRecordRelationFilterDisplayValue = ({
recordFilter,
}: UseComputeRecordRelationFilterDisplayValueParams) => {
+ const { t } = useLingui();
const { objectMetadataItems } = useObjectMetadataItems();
if (!isDefined(recordFilter.fieldMetadataId)) {
diff --git a/packages/twenty-front/src/modules/views/hooks/useComputeRecordRelationFilterLabelValue.tsx b/packages/twenty-front/src/modules/views/hooks/useComputeRecordRelationFilterLabelValue.tsx
index f25b383f594..0956784ee45 100644
--- a/packages/twenty-front/src/modules/views/hooks/useComputeRecordRelationFilterLabelValue.tsx
+++ b/packages/twenty-front/src/modules/views/hooks/useComputeRecordRelationFilterLabelValue.tsx
@@ -3,7 +3,7 @@ import { useComputeRecordRelationFilterDisplayValue } from '@/views/hooks/useCom
import { useGetRecordFilterChipLabelValue } from '@/views/hooks/useGetRecordFilterChipLabelValue';
import { isNonEmptyString } from '@sniptt/guards';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type ObjectFilterDropdownRecordSelectProps = {
recordFilter: RecordFilter;
@@ -13,6 +13,7 @@ type ObjectFilterDropdownRecordSelectProps = {
export const useComputeRecordRelationFilterLabelValue = ({
recordFilter,
}: ObjectFilterDropdownRecordSelectProps) => {
+ const { t } = useLingui();
const { getRecordFilterChipLabelValue } = useGetRecordFilterChipLabelValue();
const { displayValue, loading } = useComputeRecordRelationFilterDisplayValue({
diff --git a/packages/twenty-front/src/modules/views/hooks/useOpenAnyFieldSearchFilterFromViewBar.ts b/packages/twenty-front/src/modules/views/hooks/useOpenAnyFieldSearchFilterFromViewBar.ts
index f68d73fdee6..045177ec70e 100644
--- a/packages/twenty-front/src/modules/views/hooks/useOpenAnyFieldSearchFilterFromViewBar.ts
+++ b/packages/twenty-front/src/modules/views/hooks/useOpenAnyFieldSearchFilterFromViewBar.ts
@@ -4,10 +4,11 @@ import { anyFieldFilterValueComponentState } from '@/object-record/record-filter
import { useRecordIndexContextOrThrow } from '@/object-record/record-index/contexts/RecordIndexContext';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
+import { useLingui } from '@lingui/react/macro';
export const useOpenAnyFieldSearchFilterFromViewBar = () => {
+ const { t } = useLingui();
const setAnyFieldFilterValue = useSetAtomComponentState(
anyFieldFilterValueComponentState,
);
diff --git a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerContentEditMode.tsx b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerContentEditMode.tsx
index 2bd2dd0bde1..7f289e18727 100644
--- a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerContentEditMode.tsx
+++ b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerContentEditMode.tsx
@@ -22,10 +22,11 @@ import { viewPickerInputNameComponentState } from '@/views/view-picker/states/vi
import { viewPickerIsDirtyComponentState } from '@/views/view-picker/states/viewPickerIsDirtyComponentState';
import { viewPickerIsPersistingComponentState } from '@/views/view-picker/states/viewPickerIsPersistingComponentState';
import { viewPickerSelectedIconComponentState } from '@/views/view-picker/states/viewPickerSelectedIconComponentState';
-import { t } from '@lingui/core/macro';
import { IconChevronLeft } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
export const ViewPickerContentEditMode = () => {
+ const { t } = useLingui();
const dropdownId = useAvailableComponentInstanceIdOrThrow(
DropdownComponentInstanceContext,
);
diff --git a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerDropdown.tsx b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerDropdown.tsx
index 737d603420e..08164821ced 100644
--- a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerDropdown.tsx
+++ b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerDropdown.tsx
@@ -14,12 +14,12 @@ import { useUpdateViewFromCurrentState } from '@/views/view-picker/hooks/useUpda
import { useViewPickerMode } from '@/views/view-picker/hooks/useViewPickerMode';
import { getViewPickerDropdownId } from '@/views/view-picker/utils/getViewPickerDropdownId';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { IconChevronDown, IconList } from 'twenty-ui/icon';
import { useIcons } from 'twenty-ui/icon/provider';
import { MOBILE_VIEWPORT, useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledIconContainer = styled.span`
display: flex;
@@ -49,6 +49,7 @@ const StyledViewName = styled.span`
`;
export const ViewPickerDropdown = () => {
+ const { t } = useLingui();
const theme = useTheme();
const { currentView } = useGetCurrentViewOnly();
diff --git a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerEditButton.tsx b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerEditButton.tsx
index e32031ba57e..3249947d467 100644
--- a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerEditButton.tsx
+++ b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerEditButton.tsx
@@ -12,10 +12,11 @@ import { useViewPickerMode } from '@/views/view-picker/hooks/useViewPickerMode';
import { viewPickerIsPersistingComponentState } from '@/views/view-picker/states/viewPickerIsPersistingComponentState';
import { viewPickerMainGroupByFieldMetadataIdComponentState } from '@/views/view-picker/states/viewPickerMainGroupByFieldMetadataIdComponentState';
import { viewPickerTypeComponentState } from '@/views/view-picker/states/viewPickerTypeComponentState';
-import { t } from '@lingui/core/macro';
import { Button } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
export const ViewPickerEditButton = () => {
+ const { t } = useLingui();
const { availableFieldsForGrouping, navigateToSelectSettings } =
useGetAvailableFieldsToGroupRecordsBy();
diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowEditUpdateEventFieldsMultiSelect.tsx b/packages/twenty-front/src/modules/workflow/components/WorkflowEditUpdateEventFieldsMultiSelect.tsx
index 1ca5ca6a2e0..e1a17da4a61 100644
--- a/packages/twenty-front/src/modules/workflow/components/WorkflowEditUpdateEventFieldsMultiSelect.tsx
+++ b/packages/twenty-front/src/modules/workflow/components/WorkflowEditUpdateEventFieldsMultiSelect.tsx
@@ -4,11 +4,11 @@ import { FormMultiSelectFieldInput } from '@/object-record/record-field/ui/form-
import { type FieldMultiSelectValue } from '@/object-record/record-field/ui/types/FieldMetadata';
import { isFieldRelation } from '@/object-record/record-field/ui/types/guards/isFieldRelation';
import { shouldDisplayFormField } from '@/workflow/workflow-steps/workflow-actions/utils/shouldDisplayFormField';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
import { useIcons } from 'twenty-ui/icon/provider';
import { RelationType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const WorkflowFieldsMultiSelect = ({
label,
@@ -29,6 +29,7 @@ export const WorkflowFieldsMultiSelect = ({
actionType: 'UPDATE_RECORD' | 'UPSERT_RECORD' | 'DATABASE_EVENT';
hint?: string;
}) => {
+ const { t } = useLingui();
const { getIcon } = useIcons();
const inlineFieldMetadataItems = objectMetadataItem?.fields
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCreateStepElement.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCreateStepElement.tsx
index f8670cad41a..fc2e2103841 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCreateStepElement.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCreateStepElement.tsx
@@ -3,10 +3,10 @@ import { VERTICAL_DISTANCE_BETWEEN_TWO_NODES } from '@/workflow/workflow-diagram
import { useStartNodeCreation } from '@/workflow/workflow-diagram/hooks/useStartNodeCreation';
import { type WorkflowDiagramStepNodeData } from '@/workflow/workflow-diagram/types/WorkflowDiagram';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconPlus } from 'twenty-ui/icon';
import { IconButton } from 'twenty-ui/components/input';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
align-items: center;
@@ -35,6 +35,7 @@ export const WorkflowDiagramCreateStepElement = ({
data,
Label,
}: WorkflowDiagramCreateStepElementProps) => {
+ const { t } = useLingui();
const { startNodeCreation } = useStartNodeCreation();
const addNode = () => {
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/hooks/useWorkflowNodeLabel.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/hooks/useWorkflowNodeLabel.ts
index 40fc8768493..782ce3d45f4 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/hooks/useWorkflowNodeLabel.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/hooks/useWorkflowNodeLabel.ts
@@ -4,12 +4,13 @@ import { logicFunctionsSelector } from '@/logic-functions/states/logicFunctionsS
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { type WorkflowDiagramStepNodeData } from '@/workflow/workflow-diagram/types/WorkflowDiagram';
import { isDefined } from 'twenty-shared/utils';
-import { t } from '@lingui/core/macro';
import { getActionHeaderTypeOrThrow } from '@/workflow/workflow-steps/workflow-actions/utils/getActionHeaderTypeOrThrow';
+import { useLingui } from '@lingui/react/macro';
export const useWorkflowNodeLabel = (
data: WorkflowDiagramStepNodeData,
): string => {
+ const { t } = useLingui();
const logicFunctions = useAtomStateValue(logicFunctionsSelector);
const logicFunctionId =
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowExpectedOutputBodyInput.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowExpectedOutputBodyInput.tsx
index c3c7a23445c..51d9b2cb189 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowExpectedOutputBodyInput.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowExpectedOutputBodyInput.tsx
@@ -1,9 +1,9 @@
import { FormRawJsonFieldInput } from '@/object-record/record-field/ui/form-types/components/FormRawJsonFieldInput';
import { parseAndValidateVariableFriendlyStringifiedJson } from '~/utils/parseAndValidateVariableFriendlyStringifiedJson';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
type WorkflowExpectedOutputBodyInputProps = {
label?: string;
@@ -20,6 +20,7 @@ export const WorkflowExpectedOutputBodyInput = ({
readonly,
onChange,
}: WorkflowExpectedOutputBodyInputProps) => {
+ const { t } = useLingui();
const [error, setError] = useState<string | undefined>();
const [errorVisible, setErrorVisible] = useState(false);
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterAddFilterRuleSelect.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterAddFilterRuleSelect.tsx
index 65ad4177613..4fe8ec969c2 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterAddFilterRuleSelect.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterAddFilterRuleSelect.tsx
@@ -8,11 +8,11 @@ import { useAddStepFilterToGroup } from '@/workflow/workflow-steps/filters/hooks
import { useChildStepFiltersAndChildStepFilterGroups } from '@/workflow/workflow-steps/filters/hooks/useChildStepFiltersAndChildStepFilterGroups';
import { useUpsertStepFilterSettings } from '@/workflow/workflow-steps/filters/hooks/useUpsertStepFilterSettings';
import { buildEmptyStepFilter } from '@/workflow/workflow-steps/filters/utils/buildEmptyStepFilter';
-import { t } from '@lingui/core/macro';
import { StepLogicalOperator, type StepFilterGroup } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconLibraryPlus, IconPlus } from 'twenty-ui/icon';
import { v4 } from 'uuid';
+import { useLingui } from '@lingui/react/macro';
type WorkflowStepFilterAddFilterRuleSelectProps = {
stepFilterGroup: StepFilterGroup;
@@ -21,6 +21,7 @@ type WorkflowStepFilterAddFilterRuleSelectProps = {
export const WorkflowStepFilterAddFilterRuleSelect = ({
stepFilterGroup,
}: WorkflowStepFilterAddFilterRuleSelectProps) => {
+ const { t } = useLingui();
const { upsertStepFilterSettings } = useUpsertStepFilterSettings();
const { lastChildPosition } = useChildStepFiltersAndChildStepFilterGroups({
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterBuilder.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterBuilder.tsx
index a8338c6331c..84a00587a38 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterBuilder.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterBuilder.tsx
@@ -16,9 +16,9 @@ import {
} from '@/workflow/workflow-steps/filters/types/FilterSettings';
import { isStepFilterGroupChildAStepFilterGroup } from '@/workflow/workflow-steps/filters/utils/isStepFilterGroupChildAStepFilterGroup';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
align-items: start;
@@ -52,6 +52,7 @@ const WorkflowStepFilterBuilderConditions = ({
}: {
readonly?: boolean;
}) => {
+ const { t } = useLingui();
const rootStepFilterGroup = useAtomComponentSelectorValue(
rootLevelStepFilterGroupComponentSelector,
);
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterGroupOptionsDropdown.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterGroupOptionsDropdown.tsx
index c20dff64e10..262670f6ab8 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterGroupOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterGroupOptionsDropdown.tsx
@@ -2,12 +2,12 @@ import { DEFAULT_ADVANCED_FILTER_DROPDOWN_SIDE_OFFSET } from '@/object-record/ad
import { useRemoveStepFilterGroup } from '@/workflow/workflow-steps/filters/hooks/useRemoveStepFilterGroup';
import { WorkflowStepFilterContext } from '@/workflow/workflow-steps/filters/states/context/WorkflowStepFilterContext';
import { useContext } from 'react';
-import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { IconButton } from 'twenty-ui/components/input';
import { Dropdown } from 'twenty-ui/components/navigation';
+import { useLingui } from '@lingui/react/macro';
type WorkflowStepFilterGroupOptionsDropdownProps = {
stepFilterGroupId: string;
@@ -16,6 +16,7 @@ type WorkflowStepFilterGroupOptionsDropdownProps = {
export const WorkflowStepFilterGroupOptionsDropdown = ({
stepFilterGroupId,
}: WorkflowStepFilterGroupOptionsDropdownProps) => {
+ const { t } = useLingui();
const { readonly } = useContext(WorkflowStepFilterContext);
const { removeStepFilterGroup } = useRemoveStepFilterGroup();
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterOptionsDropdown.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterOptionsDropdown.tsx
index b1d981c029b..c1a022be71c 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterOptionsDropdown.tsx
@@ -2,12 +2,12 @@ import { DEFAULT_ADVANCED_FILTER_DROPDOWN_SIDE_OFFSET } from '@/object-record/ad
import { useRemoveStepFilter } from '@/workflow/workflow-steps/filters/hooks/useRemoveStepFilter';
import { WorkflowStepFilterContext } from '@/workflow/workflow-steps/filters/states/context/WorkflowStepFilterContext';
import { useContext } from 'react';
-import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { IconButton } from 'twenty-ui/components/input';
import { Dropdown } from 'twenty-ui/components/navigation';
+import { useLingui } from '@lingui/react/macro';
type WorkflowStepFilterOptionsDropdownProps = {
stepFilterId: string;
@@ -16,6 +16,7 @@ type WorkflowStepFilterOptionsDropdownProps = {
export const WorkflowStepFilterOptionsDropdown = ({
stepFilterId,
}: WorkflowStepFilterOptionsDropdownProps) => {
+ const { t } = useLingui();
const { readonly } = useContext(WorkflowStepFilterContext);
const { removeStepFilter } = useRemoveStepFilter();
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentConversationFields.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentConversationFields.tsx
index e78e5621469..966bf0040ec 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentConversationFields.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentConversationFields.tsx
@@ -4,9 +4,9 @@ import { type WorkflowAiAgentStepPanelProps } from '@/workflow/workflow-steps/wo
import { WorkflowConversationFields } from '@/workflow/workflow-steps/workflow-actions/components/WorkflowConversationFields';
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
-import { t } from '@lingui/core/macro';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type WorkflowAiAgentConversationFieldsProps = WorkflowAiAgentStepPanelProps;
@@ -16,6 +16,7 @@ export const WorkflowAiAgentConversationFields = ({
readonly,
onInputChange,
}: WorkflowAiAgentConversationFieldsProps) => {
+ const { t } = useLingui();
const isAiChatInboxEnabled = useIsFeatureEnabled(
FeatureFlagKey.IS_AI_CHAT_INBOX_ENABLED,
);
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentGenerateStepPromptTab.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentGenerateStepPromptTab.tsx
index d0d92e6d2aa..7004c5f3dad 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentGenerateStepPromptTab.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentGenerateStepPromptTab.tsx
@@ -4,10 +4,10 @@ import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/c
import { WorkflowAiAgentOutputFormatField } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentOutputFormatField';
import { WorkflowAiAgentPromptField } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPromptField';
import { type WorkflowAiAgentStepPanelProps } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/types/WorkflowAiAgentStepPanelProps';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useState } from 'react';
import { AUTO_SELECT_WORKSPACE_DEFAULT_MODEL_ID } from 'twenty-shared/ai';
+import { useLingui } from '@lingui/react/macro';
type WorkflowAiAgentGenerateStepPromptTabProps = WorkflowAiAgentStepPanelProps;
@@ -16,6 +16,7 @@ export const WorkflowAiAgentGenerateStepPromptTab = ({
readonly,
onInputChange,
}: WorkflowAiAgentGenerateStepPromptTabProps) => {
+ const { t } = useLingui();
const selectedModelId =
input.modelId ?? AUTO_SELECT_WORKSPACE_DEFAULT_MODEL_ID;
// decided once, so clearing the instructions does not remove the field being edited
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionList.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionList.tsx
index a5ecb3577c1..c6cf6d51e0c 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionList.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionList.tsx
@@ -1,13 +1,13 @@
import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems';
import { type SettingsRoleObjectPermissionKey } from '@/settings/roles/role-permissions/objects-permissions/constants/SettingsRoleObjectPermissionIconConfig';
import { SidePanelGroup } from '@/side-panel/components/SidePanelGroup';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { type WorkflowAiAgentObjectPermissionChange } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/types/WorkflowAiAgentObjectPermissionChange';
import { type WorkflowAiAgentObjectPermission } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/types/WorkflowAiAgentObjectPermission';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
import { CRUD_PERMISSIONS } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/constants/WorkflowAiAgentCrudPermissions';
import { WorkflowAiAgentPermissionsPermissionRow } from './WorkflowAiAgentPermissionsPermissionRow';
+import { useLingui } from '@lingui/react/macro';
const CRUD_PERMISSION_ORDER = CRUD_PERMISSIONS.reduce<
Record<SettingsRoleObjectPermissionKey, number>
@@ -32,6 +32,7 @@ export const WorkflowAiAgentPermissionList = ({
onDeletePermission,
searchQuery,
}: WorkflowAiAgentPermissionListProps) => {
+ const { t } = useLingui();
const { activeObjectMetadataItems: objectMetadataItems } =
useFilteredObjectMetadataItems();
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsCrudList.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsCrudList.tsx
index 344f51f2952..6692033c200 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsCrudList.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsCrudList.tsx
@@ -1,9 +1,9 @@
import { SidePanelGroup } from '@/side-panel/components/SidePanelGroup';
import { type SettingsRoleObjectPermissionKey } from '@/settings/roles/role-permissions/objects-permissions/constants/SettingsRoleObjectPermissionIconConfig';
-import { t } from '@lingui/core/macro';
import { type WorkflowAiAgentObjectPermissionChange } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/types/WorkflowAiAgentObjectPermissionChange';
import { type WorkflowAiAgentObjectPermission } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/types/WorkflowAiAgentObjectPermission';
import { WorkflowAiAgentPermissionsPermissionRow } from './WorkflowAiAgentPermissionsPermissionRow';
+import { useLingui } from '@lingui/react/macro';
type WorkflowAiAgentPermissionsCrudListProps = {
permissions: Array<{
@@ -23,6 +23,7 @@ export const WorkflowAiAgentPermissionsCrudList = ({
onAddPermission,
objectMetadataId,
}: WorkflowAiAgentPermissionsCrudListProps) => {
+ const { t } = useLingui();
return (
<SidePanelGroup heading={t`CRUD`}>
{permissions.map((permission) => {
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsFlagRow.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsFlagRow.tsx
index c7d3b26f124..ec061483fbf 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsFlagRow.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsFlagRow.tsx
@@ -1,12 +1,12 @@
import { ListItemIconContainer } from '@/ui/navigation/list-item/components/ListItemIconContainer';
import { type SettingsRolePermissionsSettingPermission } from '@/settings/roles/role-permissions/permission-flags/types/SettingsRolePermissionsSettingPermission';
-import { t } from '@lingui/core/macro';
import { LightIconButton } from 'twenty-ui/components/input';
import { isDefined } from 'twenty-shared/utils';
import { ListItemButton } from 'twenty-ui/components/navigation';
import { ListItem } from 'twenty-ui/primitives/navigation';
import { useTheme } from 'twenty-ui/theme';
import { IconTrash } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type WorkflowAiAgentPermissionsFlagRowProps = {
permission: SettingsRolePermissionsSettingPermission;
@@ -25,6 +25,7 @@ export const WorkflowAiAgentPermissionsFlagRow = ({
onAdd,
onDelete,
}: WorkflowAiAgentPermissionsFlagRowProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const isClickable = !readonly && !isEnabled && isDefined(onAdd);
const isDisabled = isEnabled && !shouldShowDeleteButton;
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsObjectsList.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsObjectsList.tsx
index 6b3aec42e78..354ae8163f1 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsObjectsList.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsObjectsList.tsx
@@ -1,11 +1,11 @@
import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
import { SidePanelGroup } from '@/side-panel/components/SidePanelGroup';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { ListItemButton } from 'twenty-ui/components/navigation';
import { ListItem } from 'twenty-ui/primitives/navigation';
import { IconSettings } from 'twenty-ui/icon';
import { WorkflowAiAgentPermissionsObjectRow } from './WorkflowAiAgentPermissionsObjectRow';
+import { useLingui } from '@lingui/react/macro';
type WorkflowAiAgentPermissionsObjectsListProps = {
heading?: string;
@@ -27,6 +27,7 @@ export const WorkflowAiAgentPermissionsObjectsList = ({
onSystemObjectsClick,
readonly,
}: WorkflowAiAgentPermissionsObjectsListProps) => {
+ const { t } = useLingui();
return (
<SidePanelGroup heading={heading ?? t`Objects`}>
{objects.map((objectMetadata) => (
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsPermissionRow.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsPermissionRow.tsx
index c74306dbe40..b2c1d973927 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsPermissionRow.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsPermissionRow.tsx
@@ -1,11 +1,11 @@
import { PermissionIcon } from '@/settings/roles/role-permissions/objects-permissions/components/PermissionIcon';
import { type SettingsRoleObjectPermissionKey } from '@/settings/roles/role-permissions/objects-permissions/constants/SettingsRoleObjectPermissionIconConfig';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { LightIconButton } from 'twenty-ui/components/input';
import { ListItemButton } from 'twenty-ui/components/navigation';
import { ListItem } from 'twenty-ui/primitives/navigation';
import { IconTrash } from 'twenty-ui/icon';
+import { useLingui } from '@lingui/react/macro';
type WorkflowAiAgentPermissionsPermissionRowProps = {
permission: {
@@ -29,6 +29,7 @@ export const WorkflowAiAgentPermissionsPermissionRow = ({
onAdd,
onDelete,
}: WorkflowAiAgentPermissionsPermissionRowProps) => {
+ const { t } = useLingui();
const isClickable = !readonly && !isEnabled && isDefined(onAdd);
const isDisabled = isEnabled && !shouldShowDeleteButton;
const shouldShowTrashButton = isEnabled && shouldShowDeleteButton;
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsTab.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsTab.tsx
index 9dfa446add5..9e95d7f6174 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsTab.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsTab.tsx
@@ -9,7 +9,6 @@ import { workflowAiAgentPermissionsIsAddingPermissionState } from '@/workflow/wo
import { workflowAiAgentPermissionsIsSystemObjectsListOpenState } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentPermissionsIsSystemObjectsListOpenState';
import { workflowAiAgentPermissionsSelectedObjectIdState } from '@/workflow/workflow-steps/workflow-actions/ai-agent-action/states/workflowAiAgentPermissionsSelectedObjectIdState';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { type AiRunScope } from 'twenty-shared/ai';
import { isDefined } from 'twenty-shared/utils';
@@ -25,6 +24,7 @@ import { themeCssVariables } from 'twenty-ui/theme';
import { WorkflowAiAgentPermissionsCrudList } from './WorkflowAiAgentPermissionsCrudList';
import { WorkflowAiAgentPermissionsFlagList } from './WorkflowAiAgentPermissionsFlagList';
import { WorkflowAiAgentPermissionsObjectsList } from './WorkflowAiAgentPermissionsObjectsList';
+import { useLingui } from '@lingui/react/macro';
const StyledSearchInputContainer = styled.div`
background-color: ${themeCssVariables.background.transparent.lighter};
@@ -69,6 +69,7 @@ export const WorkflowAiAgentPermissionsTab = ({
readonly,
onScopeChange,
}: WorkflowAiAgentPermissionsTabProps) => {
+ const { t } = useLingui();
const [
workflowAiAgentPermissionsSelectedObjectId,
setWorkflowAiAgentPermissionsSelectedObjectId,
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPromptField.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPromptField.tsx
index ed57b08a884..e7787998d64 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPromptField.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPromptField.tsx
@@ -1,6 +1,6 @@
import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/components/FormTextFieldInput';
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
-import { t } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react/macro';
type WorkflowAiAgentPromptFieldProps = {
prompt: string | undefined;
@@ -12,14 +12,17 @@ export const WorkflowAiAgentPromptField = ({
prompt,
readonly,
onPromptChange,
-}: WorkflowAiAgentPromptFieldProps) => (
- <FormTextFieldInput
- multiline
- VariablePicker={WorkflowVariablePicker}
- label={t`Prompt`}
- placeholder={t`Describe what you want the AI to do...`}
- defaultValue={prompt ?? ''}
- onChange={onPromptChange}
- readonly={readonly}
- />
-);
+}: WorkflowAiAgentPromptFieldProps) => {
+ const { t } = useLingui();
+ return (
+ <FormTextFieldInput
+ multiline
+ VariablePicker={WorkflowVariablePicker}
+ label={t`Prompt`}
+ placeholder={t`Describe what you want the AI to do...`}
+ defaultValue={prompt ?? ''}
+ onChange={onPromptChange}
+ readonly={readonly}
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowEditActionCodeFieldLeaf.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowEditActionCodeFieldLeaf.tsx
index a6f655ba0cc..b3f4e0d4bbe 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowEditActionCodeFieldLeaf.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowEditActionCodeFieldLeaf.tsx
@@ -10,7 +10,6 @@ import { type VariablePickerComponent } from '@/ui/input/types/VariablePickerCom
import { type FieldArrayValue } from '@/object-record/record-field/ui/types/FieldMetadata';
import { getWorkflowCodeFieldsEnumSelectOptions } from '@/workflow/workflow-steps/workflow-actions/code-action/utils/getWorkflowCodeFieldsEnumSelectOptions';
import { getWorkflowCodeFieldsLeafKind } from '@/workflow/workflow-steps/workflow-actions/code-action/utils/getWorkflowCodeFieldsLeafKind';
-import { t } from '@lingui/core/macro';
import {
isBoolean,
isNonEmptyArray,
@@ -24,6 +23,7 @@ import {
type InputSchemaProperty,
isStandaloneVariableString,
} from 'twenty-shared/workflow';
+import { useLingui } from '@lingui/react/macro';
type WorkflowEditActionCodeFieldLeafProps = {
label: string;
@@ -42,6 +42,7 @@ export const WorkflowEditActionCodeFieldLeaf = ({
onChange,
VariablePicker,
}: WorkflowEditActionCodeFieldLeafProps) => {
+ const { t } = useLingui();
const { objectMetadataItems } = useObjectMetadataItems();
const leafKind = getWorkflowCodeFieldsLeafKind(schemaProperty);
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionCreateCalendarEvent.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionCreateCalendarEvent.tsx
index 866e6d40724..472da0ee168 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionCreateCalendarEvent.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionCreateCalendarEvent.tsx
@@ -17,7 +17,6 @@ import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowS
import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter';
import { useCalendarEventForm } from '@/workflow/workflow-steps/workflow-actions/hooks/useCalendarEventForm';
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
-import { t } from '@lingui/core/macro';
import { useEffect } from 'react';
import { SettingsPath } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -26,6 +25,7 @@ import { IconPlus } from 'twenty-ui/icon';
import { type SelectOption } from 'twenty-ui/primitives/input';
import { PermissionFlagType } from '~/generated-metadata/graphql';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+import { useLingui } from '@lingui/react/macro';
type WorkflowEditActionCreateCalendarEventProps = {
action: WorkflowCreateCalendarEventAction;
@@ -43,6 +43,7 @@ export const WorkflowEditActionCreateCalendarEvent = ({
action,
actionOptions,
}: WorkflowEditActionCreateCalendarEventProps) => {
+ const { t } = useLingui();
const { formData, handleFieldChange, saveAction } = useCalendarEventForm({
action,
onActionUpdate:
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionCreateRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionCreateRecord.tsx
index d7db8beb952..e37f833f9e0 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionCreateRecord.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionCreateRecord.tsx
@@ -17,7 +17,6 @@ import {
} from '@/workflow/workflow-steps/workflow-actions/utils/buildUpdatedRecordActionFormData';
import { shouldDisplayFormField } from '@/workflow/workflow-steps/workflow-actions/utils/shouldDisplayFormField';
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
-import { t } from '@lingui/core/macro';
import { useEffect, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { canObjectBeManagedByAutomation } from 'twenty-shared/workflow';
@@ -25,6 +24,7 @@ import { Separator } from 'twenty-ui/primitives/layout';
import { type SelectOption } from 'twenty-ui/primitives/input';
import { type JsonValue } from 'type-fest';
import { useDebouncedCallback } from 'use-debounce';
+import { useLingui } from '@lingui/react/macro';
type CreateRecordFormData = RecordActionFormData;
@@ -63,6 +63,7 @@ export const WorkflowEditActionCreateRecord = ({
action,
actionOptions,
}: WorkflowEditActionCreateRecordProps) => {
+ const { t } = useLingui();
const { getSelectIconPropsFromObjectMetadataItem } =
useObjectMetadataSelectHelpers();
const { activeNonSystemObjectMetadataItems } =
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionDeleteRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionDeleteRecord.tsx
index 4d45f82dfbc..ef4a2b9b706 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionDeleteRecord.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionDeleteRecord.tsx
@@ -3,7 +3,6 @@ import { useObjectMetadataSelectHelpers } from '@/object-metadata/hooks/useObjec
import { FormSingleRecordPicker } from '@/object-record/record-field/ui/form-types/components/FormSingleRecordPicker';
import { Select } from '@/ui/input/components/Select';
import { type WorkflowDeleteRecordAction } from '@/workflow/types/Workflow';
-import { t } from '@lingui/core/macro';
import { useEffect, useState } from 'react';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
@@ -16,6 +15,7 @@ import { Separator } from 'twenty-ui/primitives/layout';
import { type SelectOption } from 'twenty-ui/primitives/input';
import { type JsonValue } from 'type-fest';
import { useDebouncedCallback } from 'use-debounce';
+import { useLingui } from '@lingui/react/macro';
type WorkflowEditActionDeleteRecordProps = {
action: WorkflowDeleteRecordAction;
@@ -38,6 +38,7 @@ export const WorkflowEditActionDeleteRecord = ({
action,
actionOptions,
}: WorkflowEditActionDeleteRecordProps) => {
+ const { t } = useLingui();
const { getSelectIconPropsFromObjectMetadataItem } =
useObjectMetadataSelectHelpers();
const { activeNonSystemObjectMetadataItems } =
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionEmailBase.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionEmailBase.tsx
index ec555a4ec7a..8560bae7669 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionEmailBase.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionEmailBase.tsx
@@ -26,7 +26,6 @@ import { WORKFLOW_EMAIL_BODY_EDITOR_PROFILE } from '@/workflow/workflow-steps/wo
import { useEmailForm } from '@/workflow/workflow-steps/workflow-actions/hooks/useEmailForm';
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useEffect, useState } from 'react';
import {
@@ -46,6 +45,7 @@ import { IconPlus } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { PermissionFlagType } from '~/generated-metadata/graphql';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+import { useLingui } from '@lingui/react/macro';
type WorkflowEditActionEmailBaseProps = {
action: WorkflowEmailAction;
@@ -63,6 +63,7 @@ export const WorkflowEditActionEmailBase = ({
action,
actionOptions,
}: WorkflowEditActionEmailBaseProps) => {
+ const { t } = useLingui();
const { triggerApisOAuth } = useTriggerApisOAuth();
const hasConnectedAccountsPermission = useHasPermissionFlag(
PermissionFlagType.CONNECTED_ACCOUNTS,
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpdateRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpdateRecord.tsx
index 503c724a22f..ce6b4e2f936 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpdateRecord.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpdateRecord.tsx
@@ -13,7 +13,6 @@ import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/Workflo
import { type UpdateRecordFormData } from '@/workflow/workflow-steps/workflow-actions/types/UpdateRecordFormData';
import { shouldDisplayFormField } from '@/workflow/workflow-steps/workflow-actions/utils/shouldDisplayFormField';
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
-import { t } from '@lingui/core/macro';
import { useEffect, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
@@ -23,6 +22,7 @@ import { type SelectOption } from 'twenty-ui/primitives/input';
import { type JsonValue } from 'type-fest';
import { useDebouncedCallback } from 'use-debounce';
import { RelationType } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type WorkflowEditActionUpdateRecordProps = {
action: WorkflowUpdateRecordAction;
@@ -40,6 +40,7 @@ export const WorkflowEditActionUpdateRecord = ({
action,
actionOptions,
}: WorkflowEditActionUpdateRecordProps) => {
+ const { t } = useLingui();
const { getSelectIconPropsFromObjectMetadataItem } =
useObjectMetadataSelectHelpers();
const { activeNonSystemObjectMetadataItems } =
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx
index bd1eb9c7321..48cef27f676 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx
@@ -19,7 +19,6 @@ import {
} from '@/workflow/workflow-steps/workflow-actions/utils/buildUpdatedRecordActionFormData';
import { shouldDisplayFormField } from '@/workflow/workflow-steps/workflow-actions/utils/shouldDisplayFormField';
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
-import { t } from '@lingui/core/macro';
import { useEffect, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { canObjectBeManagedByAutomation } from 'twenty-shared/workflow';
@@ -27,6 +26,7 @@ import { Separator } from 'twenty-ui/primitives/layout';
import { type SelectOption } from 'twenty-ui/primitives/input';
import { type JsonValue } from 'type-fest';
import { useDebouncedCallback } from 'use-debounce';
+import { useLingui } from '@lingui/react/macro';
type UpsertRecordFormData = RecordActionFormData;
@@ -73,6 +73,7 @@ export const WorkflowEditActionUpsertRecord = ({
action,
actionOptions,
}: WorkflowEditActionUpsertRecordProps) => {
+ const { t } = useLingui();
const { getSelectIconPropsFromObjectMetadataItem } =
useObjectMetadataSelectHelpers();
const { activeNonSystemObjectMetadataItems } =
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/delay-actions/components/WorkflowEditActionDelay.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/delay-actions/components/WorkflowEditActionDelay.tsx
index 787ea9317b9..19d0bfe31dc 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/delay-actions/components/WorkflowEditActionDelay.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/delay-actions/components/WorkflowEditActionDelay.tsx
@@ -6,11 +6,11 @@ import { type WorkflowDelayAction } from '@/workflow/types/Workflow';
import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody';
import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter';
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
-import { t } from '@lingui/core/macro';
import { useEffect, useState } from 'react';
import { IconCalendar, IconHourglassHigh } from 'twenty-ui/icon';
import { Separator } from 'twenty-ui/primitives/layout';
import { type SelectOption } from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
type WorkflowEditActionDelayProps = {
action: WorkflowDelayAction;
@@ -28,6 +28,7 @@ export const WorkflowEditActionDelay = ({
action,
actionOptions,
}: WorkflowEditActionDelayProps) => {
+ const { t } = useLingui();
const [localDuration, setLocalDuration] = useState<{
days?: number | string;
hours?: number | string;
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormFieldSettings.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormFieldSettings.tsx
index 5fae9c8a4b7..e68326d657d 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormFieldSettings.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormFieldSettings.tsx
@@ -7,10 +7,11 @@ import { type WorkflowFormActionField } from '@/workflow/workflow-steps/workflow
import { type WorkflowFormFieldType } from '@/workflow/workflow-steps/workflow-actions/form-action/types/WorkflowFormFieldType';
import { getDefaultFormFieldSettings } from '@/workflow/workflow-steps/workflow-actions/form-action/utils/getDefaultFormFieldSettings';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { LightIconButton } from 'twenty-ui/components/input';
import { IconSettingsAutomation, IconX } from 'twenty-ui/icon';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
+
type WorkflowEditActionFormFieldSettingsProps = {
field: WorkflowFormActionField;
onChange: (field: WorkflowFormActionField) => void;
@@ -61,6 +62,7 @@ export const WorkflowEditActionFormFieldSettings = ({
onChange,
onClose,
}: WorkflowEditActionFormFieldSettingsProps) => {
+ const { t } = useLingui();
const theme = useTheme();
return (
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsDate.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsDate.tsx
index aa88338bd9e..b963ee0c286 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsDate.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsDate.tsx
@@ -4,9 +4,9 @@ import { InputLabel } from '@/ui/input/components/internal/InputLabel/InputLabel
import { type WorkflowFormActionField } from '@/workflow/workflow-steps/workflow-actions/form-action/types/WorkflowFormActionField';
import { getDefaultFormFieldSettings } from '@/workflow/workflow-steps/workflow-actions/form-action/utils/getDefaultFormFieldSettings';
import { getFormFieldDisplayText } from '@/workflow/workflow-steps/workflow-actions/form-action/utils/getFormFieldDisplayText';
-import { t } from '@lingui/core/macro';
import camelCase from 'lodash.camelcase';
import { FieldMetadataType } from 'twenty-shared/types';
+import { useLingui } from '@lingui/react/macro';
type WorkflowFormFieldSettingsDateProps = {
field: WorkflowFormActionField;
@@ -17,6 +17,7 @@ export const WorkflowFormFieldSettingsDate = ({
field,
onChange,
}: WorkflowFormFieldSettingsDateProps) => {
+ const { t } = useLingui();
return (
<FormFieldInputContainer>
<InputLabel>{t`Label`}</InputLabel>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsNumber.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsNumber.tsx
index 3146af1b230..8318951b272 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsNumber.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsNumber.tsx
@@ -5,10 +5,10 @@ import { type WorkflowFormActionField } from '@/workflow/workflow-steps/workflow
import { getDefaultFormFieldSettings } from '@/workflow/workflow-steps/workflow-actions/form-action/utils/getDefaultFormFieldSettings';
import { getFormFieldDisplayText } from '@/workflow/workflow-steps/workflow-actions/form-action/utils/getFormFieldDisplayText';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import camelCase from 'lodash.camelcase';
import { FieldMetadataType } from 'twenty-shared/types';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type WorkflowFormFieldSettingsNumberProps = {
field: WorkflowFormActionField;
@@ -25,6 +25,7 @@ export const WorkflowFormFieldSettingsNumber = ({
field,
onChange,
}: WorkflowFormFieldSettingsNumberProps) => {
+ const { t } = useLingui();
return (
<StyledContainer>
<FormFieldInputContainer>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsRecordPicker.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsRecordPicker.tsx
index a583b7dd0cc..8d8fa5645bf 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsRecordPicker.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsRecordPicker.tsx
@@ -9,10 +9,10 @@ import { type WorkflowFormActionField } from '@/workflow/workflow-steps/workflow
import { getDefaultFormFieldSettings } from '@/workflow/workflow-steps/workflow-actions/form-action/utils/getDefaultFormFieldSettings';
import { getFormFieldDisplayText } from '@/workflow/workflow-steps/workflow-actions/form-action/utils/getFormFieldDisplayText';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import camelCase from 'lodash.camelcase';
import { type SelectOption } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type WorkflowFormFieldSettingsRecordPickerProps = {
field: WorkflowFormActionField;
@@ -29,6 +29,7 @@ export const WorkflowFormFieldSettingsRecordPicker = ({
field,
onChange,
}: WorkflowFormFieldSettingsRecordPickerProps) => {
+ const { t } = useLingui();
const { getSelectIconPropsFromObjectMetadataItem } =
useObjectMetadataSelectHelpers();
const { activeNonSystemObjectMetadataItems } =
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsSelect.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsSelect.tsx
index 16763fe3b3b..3ef271f2d18 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsSelect.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsSelect.tsx
@@ -8,9 +8,9 @@ import { type WorkflowFormActionField } from '@/workflow/workflow-steps/workflow
import { getDefaultFormFieldSettings } from '@/workflow/workflow-steps/workflow-actions/form-action/utils/getDefaultFormFieldSettings';
import { getFormFieldDisplayText } from '@/workflow/workflow-steps/workflow-actions/form-action/utils/getFormFieldDisplayText';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import camelCase from 'lodash.camelcase';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type WorkflowFormFieldSettingsSelectProps = {
field: WorkflowFormActionField;
@@ -33,6 +33,7 @@ export const WorkflowFormFieldSettingsSelect = ({
field,
onChange,
}: WorkflowFormFieldSettingsSelectProps) => {
+ const { t } = useLingui();
const selectTypeOptions = [
{
label: t`Existing Field`,
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsText.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsText.tsx
index 4ff8264a141..64aab8b60f8 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsText.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsText.tsx
@@ -5,10 +5,10 @@ import { type WorkflowFormActionField } from '@/workflow/workflow-steps/workflow
import { getDefaultFormFieldSettings } from '@/workflow/workflow-steps/workflow-actions/form-action/utils/getDefaultFormFieldSettings';
import { getFormFieldDisplayText } from '@/workflow/workflow-steps/workflow-actions/form-action/utils/getFormFieldDisplayText';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import camelCase from 'lodash.camelcase';
import { FieldMetadataType } from 'twenty-shared/types';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type WorkflowFormFieldSettingsTextProps = {
field: WorkflowFormActionField;
@@ -25,6 +25,7 @@ export const WorkflowFormFieldSettingsText = ({
field,
onChange,
}: WorkflowFormFieldSettingsTextProps) => {
+ const { t } = useLingui();
return (
<StyledContainer>
<FormFieldInputContainer>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/hooks/useUploadWorkflowFile.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/hooks/useUploadWorkflowFile.ts
index 3ed47812364..d48674be5e7 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/hooks/useUploadWorkflowFile.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/hooks/useUploadWorkflowFile.ts
@@ -1,14 +1,15 @@
import { MAX_ATTACHMENT_SIZE } from '@/advanced-text-editor/utils/maxAttachmentSize';
import { useDirectFileUpload } from '@/file/hooks/useDirectFileUpload';
import { formatFileSize } from '@/file/utils/formatFileSize';
-import { t } from '@lingui/core/macro';
import { extractFolderPathFilenameAndTypeOrThrow } from 'twenty-shared/utils';
import { type WorkflowAttachment } from 'twenty-shared/workflow';
import { useToast } from 'twenty-ui/components/feedback';
import { FileFolder } from '~/generated-metadata/graphql';
import { logError } from '~/utils/logError';
+import { useLingui } from '@lingui/react/macro';
export const useUploadWorkflowFile = () => {
+ const { t } = useLingui();
const { uploadFile: directUploadFile } = useDirectFileUpload();
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/BodyInput.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/BodyInput.tsx
index 55eba24c826..94795600fd8 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/BodyInput.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/BodyInput.tsx
@@ -13,7 +13,6 @@ import { getBodyTypeFromHeaders } from '@/workflow/workflow-steps/workflow-actio
import { parseHttpJsonBodyWithoutVariablesOrThrow } from '@/workflow/workflow-steps/workflow-actions/http-request-action/utils/parseHttpJsonBodyWithoutVariablesOrThrow';
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isString } from '@sniptt/guards';
import { useState } from 'react';
import { isDefined, parseJson } from 'twenty-shared/utils';
@@ -25,6 +24,7 @@ import { IconFileText, IconKey } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
import { type JsonValue } from 'type-fest';
import { KeyValuePairInput } from './KeyValuePairInput';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: flex;
@@ -59,6 +59,7 @@ export const BodyInput = ({
readonly,
headers,
}: BodyInputProps) => {
+ const { t } = useLingui();
const defaultValueParsed = isString(defaultValue)
? (parseJson<JsonValue>(defaultValue) ?? {})
: defaultValue;
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/HttpRequestTestVariableInput.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/HttpRequestTestVariableInput.tsx
index c5ea44f49cb..01e7726e98d 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/HttpRequestTestVariableInput.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/HttpRequestTestVariableInput.tsx
@@ -6,9 +6,9 @@ import { type HttpRequestFormData } from '@/workflow/workflow-steps/workflow-act
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
import { httpRequestTestDataFamilyState } from '@/workflow/workflow-steps/workflow-actions/http-request-action/states/httpRequestTestDataFamilyState';
-import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledVariableInputsContainer = styled.div`
display: flex;
@@ -27,6 +27,7 @@ export const HttpRequestTestVariableInput = ({
actionId,
readonly,
}: HttpRequestTestVariableInputProps) => {
+ const { t } = useLingui();
const httpRequestTestData = useAtomFamilyStateValue(
httpRequestTestDataFamilyState,
actionId,
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/hooks/useTestHttpRequest.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/hooks/useTestHttpRequest.ts
index c55d55a49b6..c1ca8259a05 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/hooks/useTestHttpRequest.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/hooks/useTestHttpRequest.ts
@@ -8,7 +8,6 @@ import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAto
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
import { httpRequestTestDataFamilyState } from '@/workflow/workflow-steps/workflow-actions/http-request-action/states/httpRequestTestDataFamilyState';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { isObject, isString } from '@sniptt/guards';
import { useState } from 'react';
import { isDefined, parseJson, resolveInput } from 'twenty-shared/utils';
@@ -17,6 +16,7 @@ import {
type TestHttpRequestMutation,
type TestHttpRequestMutationVariables,
} from '~/generated/graphql';
+import { useLingui } from '@lingui/react/macro';
const convertFlatVariablesToNestedContext = (flatVariables: {
[variablePath: string]: any;
@@ -42,6 +42,7 @@ const convertFlatVariablesToNestedContext = (flatVariables: {
};
export const useTestHttpRequest = (actionId: string) => {
+ const { t } = useLingui();
const apolloCoreClient = useApolloCoreClient();
const [isTesting, setIsTesting] = useState(false);
const httpRequestTestData = useAtomFamilyStateValue(
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/if-else-action/components/WorkflowEditActionIfElseBody.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/if-else-action/components/WorkflowEditActionIfElseBody.tsx
index 30a8154b4c1..321db575f4f 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/if-else-action/components/WorkflowEditActionIfElseBody.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/if-else-action/components/WorkflowEditActionIfElseBody.tsx
@@ -22,7 +22,6 @@ import { getBranchesToDelete } from '@/workflow/workflow-steps/workflow-actions/
import { useStepsOutputSchema } from '@/workflow/workflow-variables/hooks/useStepsOutputSchema';
import { useTidyUpWorkflowVersion } from '@/workflow/workflow-version/hooks/useTidyUpWorkflowVersion';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Fragment } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { type StepIfElseBranch } from 'twenty-shared/workflow';
@@ -30,6 +29,7 @@ import { IconPlus } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { Separator } from 'twenty-ui/primitives/layout';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
align-items: start;
@@ -54,6 +54,7 @@ export const WorkflowEditActionIfElseBody = ({
action,
actionOptions,
}: WorkflowEditActionIfElseBodyProps) => {
+ const { t } = useLingui();
const branches = action.settings.input.branches;
const stepFilterGroups = action.settings.input.stepFilterGroups ?? [];
const stepFilters = action.settings.input.stepFilters ?? [];
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/iterator-action/components/WorkflowIteratorSubStepSwitcher.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/iterator-action/components/WorkflowIteratorSubStepSwitcher.tsx
index 7de9ab16687..4f19b0d7809 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/iterator-action/components/WorkflowIteratorSubStepSwitcher.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/iterator-action/components/WorkflowIteratorSubStepSwitcher.tsx
@@ -7,11 +7,12 @@ import { getStepDefinitionOrThrow } from '@/workflow/utils/getStepDefinitionOrTh
import { getIsDescendantOfIterator } from '@/workflow/workflow-steps/utils/getIsDescendantOfIterator';
import { getWorkflowRunAllStepInfoHistory } from '@/workflow/workflow-steps/utils/getWorkflowRunAllStepInfoHistory';
import { styled } from '@linaria/react';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, IconChevronRight } from 'twenty-ui/icon';
import { IconButton } from 'twenty-ui/components/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
align-items: center;
@@ -31,6 +32,7 @@ export const WorkflowIteratorSubStepSwitcher = ({
}: {
stepId: string;
}) => {
+ const { t } = useLingui();
const flow = useFlowOrThrow();
const workflowRunId = useWorkflowRunIdOrThrow();
const workflowRun = useWorkflowRun({ workflowRunId });
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/send-chat-message-action/components/WorkflowEditActionSendChatMessage.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/send-chat-message-action/components/WorkflowEditActionSendChatMessage.tsx
index fa49c861259..4e6ae9934be 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/send-chat-message-action/components/WorkflowEditActionSendChatMessage.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/send-chat-message-action/components/WorkflowEditActionSendChatMessage.tsx
@@ -9,13 +9,13 @@ import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/Workflo
import { WorkflowConversationFields } from '@/workflow/workflow-steps/workflow-actions/components/WorkflowConversationFields';
import { WorkflowSendChatMessageToolArguments } from '@/workflow/workflow-steps/workflow-actions/send-chat-message-action/components/WorkflowSendChatMessageToolArguments';
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
-import { t } from '@lingui/core/macro';
import { useEffect, useMemo, useState } from 'react';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { doNotTranslate } from 'twenty-shared/i18n';
import { type WorkflowConversation } from 'twenty-shared/workflow';
import { useDebouncedCallback } from 'use-debounce';
+import { useLingui } from '@lingui/react/macro';
type SendChatMessageFormData =
WorkflowSendChatMessageAction['settings']['input'];
@@ -38,6 +38,7 @@ export const WorkflowEditActionSendChatMessage = ({
action,
actionOptions,
}: WorkflowEditActionSendChatMessageProps) => {
+ const { t } = useLingui();
const { toolIndex } = useGetToolIndex();
const [formData, setFormData] = useState<SendChatMessageFormData>(
action.settings.input,
@@ -122,7 +123,7 @@ export const WorkflowEditActionSendChatMessage = ({
},
]
: [noneOption, ...indexedToolOptions];
- }, [toolIndex, storedToolName]);
+ }, [toolIndex, storedToolName, t]);
return (
<>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/send-chat-message-action/components/WorkflowSendChatMessageToolArguments.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/send-chat-message-action/components/WorkflowSendChatMessageToolArguments.tsx
index 733e8d3a92c..ee15a905c00 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/send-chat-message-action/components/WorkflowSendChatMessageToolArguments.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/send-chat-message-action/components/WorkflowSendChatMessageToolArguments.tsx
@@ -7,7 +7,6 @@ import { buildToolArgumentFields } from '@/workflow/workflow-steps/workflow-acti
import { isEmptyToolArgument } from '@/workflow/workflow-steps/workflow-actions/send-chat-message-action/utils/isEmptyToolArgument';
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useMemo, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -15,6 +14,7 @@ import { isStandaloneVariableString } from 'twenty-shared/workflow';
import { LightButton } from 'twenty-ui/components/input';
import { themeCssVariables } from 'twenty-ui/theme';
import { GetToolInputSchemaDocument } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledArguments = styled.div`
display: flex;
@@ -53,6 +53,7 @@ export const WorkflowSendChatMessageToolArguments = ({
readonly,
onChange,
}: WorkflowSendChatMessageToolArgumentsProps) => {
+ const { t } = useLingui();
const { data, loading } = useQuery(GetToolInputSchemaDocument, {
variables: { toolName },
});
diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/CronExpressionHelper.tsx b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/CronExpressionHelper.tsx
index d137610e39b..411b49b1bad 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/CronExpressionHelper.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/CronExpressionHelper.tsx
@@ -7,12 +7,12 @@ import { convertScheduleToCronExpression } from '@/workflow/workflow-trigger/uti
import { normalizeCronExpression } from '~/utils/cron-to-human/utils/normalizeCronExpression';
import { getTriggerScheduleDescription } from '@/workflow/workflow-trigger/utils/getTriggerScheduleDescription';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { CronExpressionParser } from 'cron-parser';
import { themeCssVariables } from 'twenty-ui/theme';
import { dateLocaleState } from '@/localization/states/dateLocaleState';
import { formatDateTimeString } from '@/object-record/record-field/ui/utils/formatDateTimeString';
import { doNotTranslate } from 'twenty-shared/i18n';
+import { useLingui } from '@lingui/react/macro';
const getNextExecutions = (
cronExpression: string,
@@ -94,6 +94,7 @@ export const CronExpressionHelper = ({
isScheduleVisible = true,
isUpcomingExecutionVisible = true,
}: CronExpressionHelperProps) => {
+ const { t } = useLingui();
const { timeZone, dateFormat, timeFormat } = useDateTimeFormat();
const dateLocale = useAtomStateValue(dateLocaleState);
diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm.tsx b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm.tsx
index f3957fd31bd..c76fda3746a 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm.tsx
@@ -12,12 +12,12 @@ import {
import { getCronTriggerDefaultSettings } from '@/workflow/workflow-trigger/utils/getCronTriggerDefaultSettings';
import { getTriggerScheduleDescription } from '@/workflow/workflow-trigger/utils/getTriggerScheduleDescription';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { isNumber } from '@sniptt/guards';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { TRIGGER_STEP_ID } from 'twenty-shared/workflow';
import { dateLocaleState } from '@/localization/states/dateLocaleState';
+import { useLingui } from '@lingui/react/macro';
type WorkflowEditTriggerCronFormProps = {
trigger: WorkflowCronTrigger;
@@ -46,6 +46,7 @@ export const WorkflowEditTriggerCronForm = ({
trigger,
triggerOptions,
}: WorkflowEditTriggerCronFormProps) => {
+ const { t } = useLingui();
const [errorMessages, setErrorMessages] = useState<FormErrorMessages>({});
const [errorMessagesVisible, setErrorMessagesVisible] = useState(false);
const dateLocale = useAtomStateValue(dateLocaleState);
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx
index 341b7d51dfd..8c2c3cf7d50 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx
@@ -10,7 +10,6 @@ import { type InputSchemaPropertyType } from 'twenty-shared/workflow';
import { useAvailableVariablesInWorkflowStep } from '@/workflow/workflow-variables/hooks/useAvailableVariablesInWorkflowStep';
import { type StepOutputSchemaV2 } from '@/workflow/workflow-variables/types/StepOutputSchemaV2';
import { type WorkflowVariableStepSelection } from '@/workflow/workflow-variables/types/WorkflowVariableSelection';
-import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { useState } from 'react';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
@@ -18,6 +17,7 @@ import { Dropdown } from 'twenty-ui/components/navigation';
import { IconVariablePlus } from 'twenty-ui/icon';
import { Tooltip } from 'twenty-ui/primitives/surfaces';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledDropdownVariableButtonContainer = styled.div<{
disabled?: boolean;
@@ -52,6 +52,7 @@ export const WorkflowVariablesDropdown = ({
shouldDisplayRecordObjects,
objectNameSingularsToSelect,
}: WorkflowVariablesDropdownProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const dropdownId = `${SEARCH_VARIABLES_DROPDOWN_ID}-${instanceId}`;
const availableVariablesInWorkflowStep = useAvailableVariablesInWorkflowStep({
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownSteps.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownSteps.tsx
index b2d7fa3b86c..15c92e0a923 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownSteps.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownSteps.tsx
@@ -9,12 +9,12 @@ import {
} from '@/workflow/workflow-variables/types/WorkflowVariableSelection';
import { getWorkflowVariableSelectionFromSearchResult } from '@/workflow/workflow-variables/utils/getWorkflowVariableSelectionFromSearchResult';
import { searchWorkflowVariables } from '@/workflow/workflow-variables/utils/searchWorkflowVariables';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useState } from 'react';
import { isNonEmptyArray } from 'twenty-shared/utils';
import { useIcons } from 'twenty-ui/icon/provider';
import { Dropdown } from 'twenty-ui/components/navigation';
+import { useLingui } from '@lingui/react/macro';
type WorkflowVariablesDropdownStepsProps = {
steps: StepOutputSchemaV2[];
@@ -33,6 +33,7 @@ export const WorkflowVariablesDropdownSteps = ({
shouldDisplayRecordObjects,
objectNameSingularsToSelect,
}: WorkflowVariablesDropdownStepsProps) => {
+ const { t } = useLingui();
const { getIcon } = useIcons();
const { objectMetadataItems } = useObjectMetadataItems();
const [searchInputValue, setSearchInputValue] = useState('');
diff --git a/packages/twenty-front/src/modules/workspace/hooks/useUploadWorkspaceLogo.ts b/packages/twenty-front/src/modules/workspace/hooks/useUploadWorkspaceLogo.ts
index 190fa9c633e..0bb7ccb6e31 100644
--- a/packages/twenty-front/src/modules/workspace/hooks/useUploadWorkspaceLogo.ts
+++ b/packages/twenty-front/src/modules/workspace/hooks/useUploadWorkspaceLogo.ts
@@ -1,5 +1,4 @@
import { useDirectFileUpload } from '@/file/hooks/useDirectFileUpload';
-import { t } from '@lingui/core/macro';
import { useMutation } from '@apollo/client/react';
import { isDefined } from 'twenty-shared/utils';
import {
@@ -7,8 +6,10 @@ import {
FileFolder,
type FileWithSignedUrl,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const useUploadWorkspaceLogo = () => {
+ const { t } = useLingui();
const { createFileUploadAndPutFile } = useDirectFileUpload();
const [completeWorkspaceLogoUpload] = useMutation(
CompleteWorkspaceLogoUploadDocument,
diff --git a/packages/twenty-front/src/pages/object-core/AgentCoreIndexPage.tsx b/packages/twenty-front/src/pages/object-core/AgentCoreIndexPage.tsx
index 05342e73f13..f085bd365dc 100644
--- a/packages/twenty-front/src/pages/object-core/AgentCoreIndexPage.tsx
+++ b/packages/twenty-front/src/pages/object-core/AgentCoreIndexPage.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconLego } from 'twenty-ui/icon';
import { useTheme } from 'twenty-ui/theme';
@@ -23,10 +22,12 @@ import { hasAppliedCoreObjectFilters } from '@/object-core/filters/utils/hasAppl
import { SidePanelToggleButton } from '@/side-panel/components/SidePanelToggleButton';
import { useWorkspaceSurfaceScopedComponentInstanceId } from '@/ui/layout/hooks/useWorkspaceSurfaceScopedComponentInstanceId';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import { useLingui } from '@lingui/react/macro';
const getCoreAgentItemLink = (agent: CoreAgent) => getCoreAgentLink(agent.id);
export const AgentCoreIndexPage = () => {
+ const { t } = useLingui();
const theme = useTheme();
const tableId =
diff --git a/packages/twenty-front/src/pages/object-core/AgentCoreShowPage.tsx b/packages/twenty-front/src/pages/object-core/AgentCoreShowPage.tsx
index 610825067ff..c09bcd8dc78 100644
--- a/packages/twenty-front/src/pages/object-core/AgentCoreShowPage.tsx
+++ b/packages/twenty-front/src/pages/object-core/AgentCoreShowPage.tsx
@@ -1,5 +1,4 @@
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useParams } from 'react-router-dom';
import { isDefined } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
@@ -13,8 +12,10 @@ import { FindOneAgentDocument } from '~/generated-metadata/graphql';
import { CoreAgentDetailSkeletonLoader } from '@/object-core/agents/components/CoreAgentDetailSkeletonLoader';
import { CoreAgentFormContent } from '@/object-core/agents/components/CoreAgentFormContent';
import { useNavigateToNotFoundOnLoadFailure } from '~/pages/settings/ai/hooks/useNavigateToNotFoundOnLoadFailure';
+import { useLingui } from '@lingui/react/macro';
export const AgentCoreShowPage = () => {
+ const { t } = useLingui();
const { agentId = '' } = useParams<{ agentId: string }>();
const theme = useTheme();
const { getIcon } = useIcons();
diff --git a/packages/twenty-front/src/pages/object-core/WorkflowCoreIndexPage.tsx b/packages/twenty-front/src/pages/object-core/WorkflowCoreIndexPage.tsx
index 55c47d75ca6..701be65577c 100644
--- a/packages/twenty-front/src/pages/object-core/WorkflowCoreIndexPage.tsx
+++ b/packages/twenty-front/src/pages/object-core/WorkflowCoreIndexPage.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { AppPath } from 'twenty-shared/types';
import { getAppPath, isDefined } from 'twenty-shared/utils';
import { IconSettingsAutomation } from 'twenty-ui/icon';
@@ -32,11 +31,13 @@ import { CoreWorkflowsPermissionGate } from '@/object-core/workflows/components/
import { SidePanelToggleButton } from '@/side-panel/components/SidePanelToggleButton';
import { ColoredIcon } from '@/ui/icon/components/ColoredIcon';
import { useWorkspaceSurfaceScopedComponentInstanceId } from '@/ui/layout/hooks/useWorkspaceSurfaceScopedComponentInstanceId';
+import { useLingui } from '@lingui/react/macro';
const getCoreWorkflowLink = (workflow: CoreWorkflow) =>
getAppPath(AppPath.WorkflowCoreShowPage, { coreWorkflowId: workflow.id });
const WorkflowCoreIndexContent = () => {
+ const { t } = useLingui();
const tableId = useWorkspaceSurfaceScopedComponentInstanceId(
CORE_WORKFLOWS_TABLE_ID,
);
diff --git a/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx b/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx
index 2f3682d72d8..5e398203261 100644
--- a/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx
+++ b/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx
@@ -5,7 +5,6 @@ import { CoreObjectIdentifierBar } from '@/object-core/components/CoreObjectIden
import { useRenameCoreWorkflow } from '@/object-core/workflows/hooks/useRenameCoreWorkflow';
import { styled } from '@linaria/react';
import { isNonEmptyString } from '@sniptt/guards';
-import { t } from '@lingui/core/macro';
import { useCallback } from 'react';
import { useParams, useSearchParams } from 'react-router-dom';
import { AppPath } from 'twenty-shared/types';
@@ -30,6 +29,7 @@ import { PageCardLayout } from '@/ui/layout/page/components/PageCardLayout';
import { PageTitle } from '@/ui/utilities/page-title/components/PageTitle';
import { getWorkflowCurrentVersion } from '@/workflow/utils/getWorkflowCurrentVersion';
import { PageContentSkeletonLoader } from '~/loading/components/PageContentSkeletonLoader';
+import { useLingui } from '@lingui/react/macro';
const StyledContainer = styled.div`
display: flex;
@@ -47,6 +47,7 @@ const CoreWorkflowShowContent = ({
}: {
coreWorkflowId: string;
}) => {
+ const { t } = useLingui();
const client = useApolloCoreClient();
const { record, coreWorkflow, loading, error, refetch } =
useCoreWorkflowShowPageResource({
diff --git a/packages/twenty-front/src/pages/onboarding/PaymentSuccess.tsx b/packages/twenty-front/src/pages/onboarding/PaymentSuccess.tsx
index b4446f889ec..000b7157337 100644
--- a/packages/twenty-front/src/pages/onboarding/PaymentSuccess.tsx
+++ b/packages/twenty-front/src/pages/onboarding/PaymentSuccess.tsx
@@ -5,13 +5,13 @@ import { useOnboardingMotionTransition } from '@/onboarding/hooks/useOnboardingM
import { useShowWelcomeAnimationAfterOnboardingCheckout } from '@/onboarding/hooks/useShowWelcomeAnimationAfterOnboardingCheckout';
import { useLoadCurrentUser } from '@/users/hooks/useLoadCurrentUser';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { AnimatePresence, motion } from 'framer-motion';
import { useEffect, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
import { MainButton } from 'twenty-ui/components/input';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const SUBSCRIPTION_CONFIRMATION_POLL_INTERVAL_MS = 2000;
const SUBSCRIPTION_CONFIRMATION_MAX_ATTEMPTS = 30;
@@ -22,6 +22,7 @@ const StyledRetryButtonContainer = styled.div`
`;
export const PaymentSuccess = () => {
+ const { t } = useLingui();
const { loadCurrentUser } = useLoadCurrentUser();
const showWelcomeAnimationAfterOnboardingCheckout =
useShowWelcomeAnimationAfterOnboardingCheckout();
diff --git a/packages/twenty-front/src/pages/settings/accounts/SettingsNewAccount.tsx b/packages/twenty-front/src/pages/settings/accounts/SettingsNewAccount.tsx
index 168507f8751..e6ff595f809 100644
--- a/packages/twenty-front/src/pages/settings/accounts/SettingsNewAccount.tsx
+++ b/packages/twenty-front/src/pages/settings/accounts/SettingsNewAccount.tsx
@@ -2,11 +2,12 @@ import { SettingsNewAccountSection } from '@/settings/accounts/components/Settin
import { useAccountsSettingsBreadcrumbLink } from '@/settings/app-preferences/hooks/useAccountsSettingsBreadcrumbLink';
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
export const SettingsNewAccount = () => {
+ const { t } = useLingui();
const accountsBreadcrumbLink = useAccountsSettingsBreadcrumbLink(t`Accounts`);
return (
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminAiProviderDetail.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminAiProviderDetail.tsx
index 60ec6031f81..3efb4940ca4 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminAiProviderDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminAiProviderDetail.tsx
@@ -19,7 +19,6 @@ import { ConfirmationDialog } from '@/ui/layout/dialog/components/ConfirmationDi
import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
import { RoundedLink } from '@/ui/navigation/link/components/RoundedLink/RoundedLink';
import { useMutation, useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useMemo, useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
@@ -43,11 +42,13 @@ import {
type AdminAiModelConfig,
SetAdminAiModelEnabledDocument,
} from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
const REMOVE_PROVIDER_MODAL_ID = 'settings-ai-provider-remove';
const REMOVE_MODEL_MODAL_ID = 'settings-ai-model-remove';
export const SettingsAdminAiProviderDetail = () => {
+ const { t } = useLingui();
const { providerName } = useParams<{ providerName: string }>();
const apolloAdminClient = useApolloAdminClient();
const navigate = useNavigate();
@@ -292,7 +293,7 @@ export const SettingsAdminAiProviderDetail = () => {
}
return items;
- }, [provider, navigate, isCustomProvider]);
+ }, [provider, navigate, isCustomProvider, t]);
const newModelPath = providerName
? getSettingsPath(SettingsPath.AdminPanelNewAiModel, { providerName })
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInferredVersion.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInferredVersion.tsx
index 92519ad79e1..cad81d060a4 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInferredVersion.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInferredVersion.tsx
@@ -4,7 +4,6 @@ import { SettingsTableCard } from '@/settings/components/SettingsTableCard';
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
import { useMutation, useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
@@ -16,6 +15,7 @@ import {
GetInstanceAndAllWorkspacesUpgradeStatusDocument,
RefreshUpgradeStatusDocument,
} from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledRefreshButtonContainer = styled.div`
display: flex;
@@ -25,6 +25,7 @@ const StyledRefreshButtonContainer = styled.div`
`;
export const SettingsAdminInferredVersion = () => {
+ const { t } = useLingui();
const apolloAdminClient = useApolloAdminClient();
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInstanceStatus.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInstanceStatus.tsx
index 6a9df7242fd..98514d3c865 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInstanceStatus.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInstanceStatus.tsx
@@ -7,7 +7,6 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { UserContext } from '@/users/contexts/UserContext';
import { useMutation, useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useContext } from 'react';
import { SettingsPath } from 'twenty-shared/types';
@@ -29,6 +28,7 @@ import {
} from '~/generated-admin/graphql';
import { dateLocaleState } from '@/localization/states/dateLocaleState';
import { formatDateTimeString } from '@/object-record/record-field/ui/utils/formatDateTimeString';
+import { useLingui } from '@lingui/react/macro';
const StyledRefreshButtonContainer = styled.div`
display: flex;
@@ -42,6 +42,7 @@ const StyledCommandValue = styled.span`
`;
export const SettingsAdminInstanceStatus = () => {
+ const { t } = useLingui();
const apolloAdminClient = useApolloAdminClient();
const { enqueueToast } = useToast();
const { dateFormat, timeFormat, timeZone } = useContext(UserContext);
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminQueueDetail.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminQueueDetail.tsx
index 5d473be3911..cbabce7bf9a 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminQueueDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminQueueDetail.tsx
@@ -1,14 +1,16 @@
import { SettingsAdminQueueJobsTable } from '@/settings/admin-panel/health-status/components/SettingsAdminQueueJobsTable';
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { useState } from 'react';
import { useParams } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
+import { useLingui } from '@lingui/react/macro';
export const SettingsAdminQueueDetail = () => {
+ const { t } = useLingui();
const { queueName } = useParams<{ queueName: string }>();
const [retentionConfig, setRetentionConfig] = useState<{
completedMaxAge: number;
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminUserDetail.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminUserDetail.tsx
index 6d0c0bce559..1cb312376e5 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminUserDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminUserDetail.tsx
@@ -3,7 +3,6 @@ import { Tabs } from 'twenty-ui/primitives/navigation';
import { useParams } from 'react-router-dom';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { SettingsPath } from 'twenty-shared/types';
import {
@@ -44,8 +43,10 @@ import {
type UserLookupAdminPanelQuery,
UserLookupAdminPanelDocument,
} from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
export const SettingsAdminUserDetail = () => {
+ const { t } = useLingui();
const { userId } = useParams<{ userId: string }>();
const apolloAdminClient = useApolloAdminClient();
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceChatThread.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceChatThread.tsx
index 074d7f2291b..6353fddd949 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceChatThread.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceChatThread.tsx
@@ -1,7 +1,6 @@
import { useParams } from 'react-router-dom';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
@@ -14,8 +13,10 @@ import { SettingsSkeletonLoader } from '@/settings/components/SettingsSkeletonLo
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
import { type GetAdminChatThreadMessagesQuery } from '~/generated-admin/graphql';
import { Section } from 'twenty-ui/components/layout';
+import { useLingui } from '@lingui/react/macro';
export const SettingsAdminWorkspaceChatThread = () => {
+ const { t } = useLingui();
const { workspaceId, threadId } = useParams<{
workspaceId: string;
threadId: string;
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx
index 04f2e79157b..586dc04e00b 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx
@@ -35,7 +35,6 @@ import { getAdminWorkspaceLabel } from '@/settings/admin-panel/utils/getAdminWor
import { getWorkspaceAvatarColorSeed } from '@/workspace/utils/getWorkspaceAvatarColorSeed';
import { useMutation, useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useParams } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
@@ -64,6 +63,7 @@ import {
type WorkspaceLookupAdminPanelQuery,
} from '~/generated-admin/graphql';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
+import { useLingui } from '@lingui/react/macro';
const StyledFeatureFlagName = styled(OverflowingTextWithTooltip)`
min-width: 0;
@@ -80,6 +80,7 @@ const WORKSPACE_DETAIL_TAB_IDS = {
};
export const SettingsAdminWorkspaceDetail = () => {
+ const { t } = useLingui();
const { workspaceId } = useParams<{ workspaceId: string }>();
const apolloAdminClient = useApolloAdminClient();
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspacesStatus.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspacesStatus.tsx
index 59714679c72..4e40ffc6b32 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspacesStatus.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspacesStatus.tsx
@@ -5,7 +5,7 @@ import { SettingsPageContainer } from '@/settings/components/SettingsPageContain
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
import { useMutation, useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { plural, t } from '@lingui/core/macro';
+import { plural } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
@@ -16,6 +16,7 @@ import {
GetInstanceAndAllWorkspacesUpgradeStatusDocument,
RefreshUpgradeStatusDocument,
} from '~/generated-admin/graphql';
+import { useLingui } from '@lingui/react/macro';
const StyledRefreshButtonContainer = styled.div`
display: flex;
@@ -31,6 +32,7 @@ const StyledAccordionCardsContainer = styled.div`
`;
export const SettingsAdminWorkspacesStatus = () => {
+ const { t } = useLingui();
const apolloAdminClient = useApolloAdminClient();
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/pages/settings/ai/SettingsAI.tsx b/packages/twenty-front/src/pages/settings/ai/SettingsAI.tsx
index 1bb82132458..e8acaed89b3 100644
--- a/packages/twenty-front/src/pages/settings/ai/SettingsAI.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/SettingsAI.tsx
@@ -10,8 +10,6 @@ import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFla
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
-
-import { t } from '@lingui/core/macro';
import { Section } from 'twenty-ui/components/layout';
import { IconPlus, IconSparkle2 } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
@@ -33,6 +31,7 @@ import {
FeatureFlagKey,
PermissionFlagType,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const AI_HERO_LIGHT = '/images/ai/ai-tools-cover-light.png';
const AI_HERO_DARK = '/images/ai/ai-tools-cover-dark.png';
@@ -40,6 +39,7 @@ const AI_HERO_DARK = '/images/ai/ai-tools-cover-dark.png';
const SETTINGS_AI_HERO_INSTANCE_ID_PREFIX = 'settings-ai-hero';
export const SettingsAI = () => {
+ const { t } = useLingui();
const { handleCreateTool, isCreatingTool } = useCreateTool();
const canReadSystemPrompts = useHasPermissionFlag(PermissionFlagType.AI);
const isInboxEnabled = useIsFeatureEnabled(
diff --git a/packages/twenty-front/src/pages/settings/ai/SettingsAiPrompts.tsx b/packages/twenty-front/src/pages/settings/ai/SettingsAiPrompts.tsx
index 2c95c53c300..a4852f0d013 100644
--- a/packages/twenty-front/src/pages/settings/ai/SettingsAiPrompts.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/SettingsAiPrompts.tsx
@@ -7,7 +7,6 @@ import { SettingsPageContainer } from '@/settings/components/SettingsPageContain
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import {
getSettingsPath,
@@ -18,6 +17,7 @@ import { Section } from 'twenty-ui/components/layout';
import { themeCssVariables } from 'twenty-ui/theme';
import { GetAiSystemPromptPreviewDocument } from '~/generated-metadata/graphql';
import { formatNumber } from '@/localization/utils/formatNumber';
+import { useLingui } from '@lingui/react/macro';
const StyledSectionHeader = styled(Section.Header)`
margin-block-end: 0;
@@ -37,6 +37,7 @@ const StyledTitleContainer = styled.div`
`;
export const SettingsAiPrompts = () => {
+ const { t } = useLingui();
const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
const { data: previewData, loading: previewLoading } = useQuery(
diff --git a/packages/twenty-front/src/pages/settings/ai/SettingsAiUsageUserDetail.tsx b/packages/twenty-front/src/pages/settings/ai/SettingsAiUsageUserDetail.tsx
index 19ce7236e4d..5280b78ed2b 100644
--- a/packages/twenty-front/src/pages/settings/ai/SettingsAiUsageUserDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/SettingsAiUsageUserDetail.tsx
@@ -7,7 +7,6 @@ import { UsageSectionSkeleton } from '@/settings/usage/components/UsageSectionSk
import { AI_OPERATION_TYPES } from '@/settings/usage/constants/AiOperationTypes';
import { useUsageAnalyticsData } from '@/settings/usage/hooks/useUsageAnalyticsData';
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
-import { t } from '@lingui/core/macro';
import { Trans, useLingui } from '@lingui/react/macro';
import { useParams } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
@@ -15,6 +14,7 @@ import { getSettingsPath } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
export const SettingsAiUsageUserDetail = () => {
+ const { t } = useLingui();
const { t: tLingui } = useLingui();
const { userWorkspaceId } = useParams<{ userWorkspaceId: string }>();
diff --git a/packages/twenty-front/src/pages/settings/ai/SettingsSkillForm.tsx b/packages/twenty-front/src/pages/settings/ai/SettingsSkillForm.tsx
index 94e866f447b..d74aedb34b7 100644
--- a/packages/twenty-front/src/pages/settings/ai/SettingsSkillForm.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/SettingsSkillForm.tsx
@@ -1,5 +1,4 @@
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useParams } from 'react-router-dom';
import { isDefined } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
@@ -13,8 +12,10 @@ import { FindOneSkillDocument } from '~/generated-metadata/graphql';
import { SettingsSkillFormContent } from '~/pages/settings/ai/components/SettingsSkillFormContent';
import { useNavigateToNotFoundOnLoadFailure } from '~/pages/settings/ai/hooks/useNavigateToNotFoundOnLoadFailure';
import { getSettingsAiBreadcrumbLinks } from '~/pages/settings/ai/utils/getSettingsAiBreadcrumbLinks';
+import { useLingui } from '@lingui/react/macro';
export const SettingsSkillForm = ({ mode }: { mode: 'create' | 'edit' }) => {
+ const { t } = useLingui();
const theme = useTheme();
const { getIcon } = useIcons();
const { skillId = '' } = useParams<{ skillId: string }>();
diff --git a/packages/twenty-front/src/pages/settings/ai/SettingsToolDetail.tsx b/packages/twenty-front/src/pages/settings/ai/SettingsToolDetail.tsx
index 0d2ed1ccd06..e89ccf4e401 100644
--- a/packages/twenty-front/src/pages/settings/ai/SettingsToolDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/SettingsToolDetail.tsx
@@ -11,7 +11,6 @@ import { ConfirmationDialog } from '@/ui/layout/dialog/components/ConfirmationDi
import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
@@ -25,10 +24,12 @@ import { useDebouncedCallback } from 'use-debounce';
import { GetToolInputSchemaDocument } from '~/generated-metadata/graphql';
import { SettingsToolIcon } from '~/pages/settings/ai/components/SettingsToolIcon';
import { SettingsToolParameterTable } from '@/settings/ai/components/SettingsToolParameterTable';
+import { useLingui } from '@lingui/react/macro';
const DELETE_TOOL_MODAL_ID = 'delete-tool-modal';
export const SettingsToolDetail = () => {
+ const { t } = useLingui();
const { toolIdentifier } = useParams();
const navigate = useNavigate();
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiBehaviorModeSelect.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiBehaviorModeSelect.tsx
index 89940904948..2ef077f4856 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiBehaviorModeSelect.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiBehaviorModeSelect.tsx
@@ -1,8 +1,8 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { Select } from 'twenty-ui/primitives/input';
import { AiChatAssistantMode } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
type SettingsAiBehaviorModeSelectProps = {
value: AiChatAssistantMode | null;
@@ -26,6 +26,7 @@ export const SettingsAiBehaviorModeSelect = ({
disabled,
isLoading,
}: SettingsAiBehaviorModeSelectProps) => {
+ const { t } = useLingui();
const options: { value: AiChatAssistantMode; label: string }[] = [
{ value: AiChatAssistantMode.NEVER, label: t`Never` },
{ value: AiChatAssistantMode.MENTION_ONLY, label: t`Only when mentioned` },
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiBehaviorSection.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiBehaviorSection.tsx
index 98dcf24c4b7..aa46aaa1ab3 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiBehaviorSection.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiBehaviorSection.tsx
@@ -2,7 +2,6 @@ import { AGENT_CHAT_ASSISTANT_NAME } from '@/ai/constants/AgentChatAssistantName
import { SettingsOptionCardContentSelect } from '@/settings/components/SettingsOptions/SettingsOptionCardContentSelect';
import { StyledSettingsSelectGroup } from '@/settings/components/SettingsOptions/StyledSettingsSelectGroup';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { useId } from 'react';
import { InlineBanner } from 'twenty-ui/components/feedback';
@@ -14,6 +13,7 @@ import { Text } from 'twenty-ui/primitives/typography';
import { themeCssVariables } from 'twenty-ui/theme';
import { SettingsAiBehaviorModeSelect } from '~/pages/settings/ai/components/SettingsAiBehaviorModeSelect';
import { type AiChatAssistantMode } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const BEHAVIOR_SELECT_CONTROL_WIDTH = 180;
@@ -43,6 +43,7 @@ export const SettingsAiBehaviorSection = ({
disabled = false,
errorMessage,
}: SettingsAiBehaviorSectionProps) => {
+ const { t } = useLingui();
const sectionId = useId();
const directMessagesLabelId = `${sectionId}-direct-messages`;
const inboxLabelId = `${sectionId}-inbox`;
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiMcpSection.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiMcpSection.tsx
index c85f39aa8da..f446fa214c8 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiMcpSection.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiMcpSection.tsx
@@ -1,13 +1,14 @@
import { SETTINGS_AI_TABS } from '@/settings/ai/constants/SettingsAiTabs';
import { SettingsCard } from '@/settings/components/SettingsCard';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
import { IconSparkles } from 'twenty-ui/icon';
import { useTheme } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
export const SettingsAiMcpSection = () => {
+ const { t } = useLingui();
const theme = useTheme();
return (
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiModelsTab.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiModelsTab.tsx
index 07bf9a69d18..69aa2a479ef 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiModelsTab.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiModelsTab.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { AI_MODEL_TIERS, type AiModelTier } from 'twenty-shared/ai';
import { Section } from 'twenty-ui/components/layout';
import { IconMessage, IconRobot, IconWand } from 'twenty-ui/icon';
@@ -31,8 +30,10 @@ import { SettingsAiModelTiersPreview } from '~/pages/settings/ai/components/Sett
import { SettingsAiSystemPromptsSection } from '~/pages/settings/ai/components/SettingsAiSystemPromptsSection';
import { SettingsAiWorkspaceInstructionsSection } from '~/pages/settings/ai/components/SettingsAiWorkspaceInstructionsSection';
import { useSettingsAiModelsActions } from '~/pages/settings/ai/hooks/useSettingsAiModelsActions';
+import { useLingui } from '@lingui/react/macro';
export const SettingsAiModelsTab = () => {
+ const { t } = useLingui();
const isInboxEnabled = useIsFeatureEnabled(
FeatureFlagKey.IS_AI_CHAT_INBOX_ENABLED,
);
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiOverview.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiOverview.tsx
index e5568359bd4..b6133cb9604 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiOverview.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiOverview.tsx
@@ -1,9 +1,9 @@
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { type SettingsAiOverviewProps } from '~/pages/settings/ai/types/SettingsAiOverviewProps';
+import { useLingui } from '@lingui/react/macro';
export const SettingsAiOverview = ({
avatarSection,
@@ -14,6 +14,7 @@ export const SettingsAiOverview = ({
workspaceInstructionsSection,
systemPromptSection,
}: SettingsAiOverviewProps) => {
+ const { t } = useLingui();
return (
<SettingsPageLayout
title={t`AI`}
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiSystemPromptsSection.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiSystemPromptsSection.tsx
index dafc8b66568..33c16c5aee3 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiSystemPromptsSection.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiSystemPromptsSection.tsx
@@ -1,6 +1,5 @@
import { SettingsCard } from '@/settings/components/SettingsCard';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
@@ -8,8 +7,10 @@ import { IconPrompt } from 'twenty-ui/icon';
import { useTheme } from 'twenty-ui/theme';
import { GetAiSystemPromptPreviewDocument } from '~/generated-metadata/graphql';
import { formatNumber } from '@/localization/utils/formatNumber';
+import { useLingui } from '@lingui/react/macro';
export const SettingsAiSystemPromptsSection = () => {
+ const { t } = useLingui();
const theme = useTheme();
const { data: previewData } = useQuery(GetAiSystemPromptPreviewDocument);
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiUsageTab.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiUsageTab.tsx
index 12f5df81617..f9e1581f83a 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiUsageTab.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiUsageTab.tsx
@@ -11,13 +11,14 @@ import { UsageSectionSkeleton } from '@/settings/usage/components/UsageSectionSk
import { AI_OPERATION_TYPES } from '@/settings/usage/constants/AiOperationTypes';
import { useUsageAnalyticsData } from '@/settings/usage/hooks/useUsageAnalyticsData';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { OrganizationAdornment } from '@/settings/enterprise/components/OrganizationAdornment';
import { Section } from 'twenty-ui/components/layout';
+import { useLingui } from '@lingui/react/macro';
export const SettingsAiUsageTab = () => {
+ const { t } = useLingui();
const currentWorkspace = useAtomStateValue(currentWorkspaceState);
const billing = useAtomStateValue(billingState);
const isBillingEnabled = billing?.isBillingEnabled ?? false;
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiWorkspaceInstructionsSection.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiWorkspaceInstructionsSection.tsx
index 5ced7abc6d8..a4cfc96403f 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiWorkspaceInstructionsSection.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiWorkspaceInstructionsSection.tsx
@@ -2,9 +2,9 @@ import { FormAdvancedTextFieldInput } from '@/advanced-text-editor/components/Fo
import { AI_INSTRUCTIONS_EDITOR_PROFILE } from '@/ai/constants/AiInstructionsEditorProfile';
import { useSettingsAiWorkspaceInstructions } from '@/settings/ai/hooks/useSettingsAiWorkspaceInstructions';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Section } from 'twenty-ui/components/layout';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
const StyledInstructionsContainer = styled.div`
display: flex;
@@ -13,6 +13,7 @@ const StyledInstructionsContainer = styled.div`
`;
export const SettingsAiWorkspaceInstructionsSection = () => {
+ const { t } = useLingui();
const {
canEditInstructions,
workspaceInstructions,
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillDangerZone.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillDangerZone.tsx
index fd0747fd327..19c02ef4486 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillDangerZone.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillDangerZone.tsx
@@ -1,6 +1,5 @@
import { useMutation } from '@apollo/client/react';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { SettingsPath } from 'twenty-shared/types';
import { useToast } from 'twenty-ui/components/feedback';
@@ -20,6 +19,7 @@ import {
type FindOneSkillQuery,
} from '~/generated-metadata/graphql';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+import { useLingui } from '@lingui/react/macro';
const StyledDangerButtonsContainer = styled.div`
display: flex;
@@ -38,6 +38,7 @@ type SettingsSkillDangerZoneProps = {
export const SettingsSkillDangerZone = ({
skill,
}: SettingsSkillDangerZoneProps) => {
+ const { t } = useLingui();
const navigate = useNavigateSettings();
const { enqueueToast } = useToast();
const { openDialog, closeDialog } = useDialog();
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillFormContent.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillFormContent.tsx
index 9f30218147e..463d0ca7ef3 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillFormContent.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillFormContent.tsx
@@ -1,5 +1,4 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { SettingsPath } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -30,6 +29,7 @@ import { getSettingsAiBreadcrumbLinks } from '~/pages/settings/ai/utils/getSetti
import { getSettingsSkillInitialFormValues } from '~/pages/settings/ai/utils/getSettingsSkillInitialFormValues';
import { computeMetadataNameFromLabel } from '@/object-metadata/utils/computeMetadataNameFromLabel';
import { useGetIsMetadataItemCustom } from '@/object-metadata/hooks/useGetIsMetadataItemCustom';
+import { useLingui } from '@lingui/react/macro';
const StyledFormContainer = styled.div`
display: flex;
@@ -58,6 +58,7 @@ type SettingsSkillFormContentProps = {
export const SettingsSkillFormContent = ({
skill,
}: SettingsSkillFormContentProps) => {
+ const { t } = useLingui();
const theme = useTheme();
const { getIcon } = useIcons();
const navigate = useNavigateSettings();
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillInactiveMenuDropDown.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillInactiveMenuDropDown.tsx
index 3dcb7f1d97e..51894587930 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillInactiveMenuDropDown.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillInactiveMenuDropDown.tsx
@@ -1,4 +1,3 @@
-import { t } from '@lingui/core/macro';
import { LightIconButton } from 'twenty-ui/components/input';
import { Dropdown } from 'twenty-ui/components/navigation';
import { IconArchiveOff, IconDotsVertical, IconTrash } from 'twenty-ui/icon';
@@ -6,6 +5,7 @@ import { IconArchiveOff, IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
+import { useLingui } from '@lingui/react/macro';
type SettingsSkillInactiveMenuDropDownProps = {
isCustomSkill: boolean;
@@ -19,35 +19,38 @@ export const SettingsSkillInactiveMenuDropDown = ({
onActivate,
onDelete,
isCustomSkill,
-}: SettingsSkillInactiveMenuDropDownProps) => (
- <DropdownRoot
- type="menu"
- dropdownId={`${skillId}-settings-skill-inactive-menu-dropdown`}
- >
- <Dropdown.Trigger
- render={
- <LightIconButton
- aria-label={t`Inactive Skill Options`}
- emphasis="subtle"
- >
- <IconDotsVertical />
- </LightIconButton>
- }
- />
- <DropdownContent align="end" width={GenericDropdownContentWidth.Narrow}>
- <Dropdown.Section>
- <Dropdown.ActionItem
- startIcon={<IconArchiveOff />}
- onClick={onActivate}
- >{t`Activate`}</Dropdown.ActionItem>
- {isCustomSkill && (
+}: SettingsSkillInactiveMenuDropDownProps) => {
+ const { t } = useLingui();
+ return (
+ <DropdownRoot
+ type="menu"
+ dropdownId={`${skillId}-settings-skill-inactive-menu-dropdown`}
+ >
+ <Dropdown.Trigger
+ render={
+ <LightIconButton
+ aria-label={t`Inactive Skill Options`}
+ emphasis="subtle"
+ >
+ <IconDotsVertical />
+ </LightIconButton>
+ }
+ />
+ <DropdownContent align="end" width={GenericDropdownContentWidth.Narrow}>
+ <Dropdown.Section>
<Dropdown.ActionItem
- startIcon={<IconTrash />}
- color="danger"
- onClick={onDelete}
- >{t`Delete`}</Dropdown.ActionItem>
- )}
- </Dropdown.Section>
- </DropdownContent>
- </DropdownRoot>
-);
+ startIcon={<IconArchiveOff />}
+ onClick={onActivate}
+ >{t`Activate`}</Dropdown.ActionItem>
+ {isCustomSkill && (
+ <Dropdown.ActionItem
+ startIcon={<IconTrash />}
+ color="danger"
+ onClick={onDelete}
+ >{t`Delete`}</Dropdown.ActionItem>
+ )}
+ </Dropdown.Section>
+ </DropdownContent>
+ </DropdownRoot>
+ );
+};
diff --git a/packages/twenty-front/src/pages/settings/ai/hooks/useCreateTool.ts b/packages/twenty-front/src/pages/settings/ai/hooks/useCreateTool.ts
index 82ad756ac37..381203b8a94 100644
--- a/packages/twenty-front/src/pages/settings/ai/hooks/useCreateTool.ts
+++ b/packages/twenty-front/src/pages/settings/ai/hooks/useCreateTool.ts
@@ -1,14 +1,14 @@
import { useState } from 'react';
import { useNavigate } from 'react-router-dom';
-
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
import { usePersistLogicFunction } from '@/logic-functions/hooks/usePersistLogicFunction';
import { useToast } from 'twenty-ui/components/feedback';
+import { useLingui } from '@lingui/react/macro';
export const useCreateTool = () => {
+ const { t } = useLingui();
const navigate = useNavigate();
const { enqueueToast } = useToast();
const { createLogicFunction } = usePersistLogicFunction();
diff --git a/packages/twenty-front/src/pages/settings/ai/hooks/useSettingsAiModelsActions.ts b/packages/twenty-front/src/pages/settings/ai/hooks/useSettingsAiModelsActions.ts
index 1e825b4aa12..22adff0efac 100644
--- a/packages/twenty-front/src/pages/settings/ai/hooks/useSettingsAiModelsActions.ts
+++ b/packages/twenty-front/src/pages/settings/ai/hooks/useSettingsAiModelsActions.ts
@@ -1,5 +1,4 @@
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { type AiModelTier } from 'twenty-shared/ai';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
@@ -13,6 +12,7 @@ import {
AiModelTier as GraphqlAiModelTier,
UpdateWorkspaceDocument,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
// Typed with the generated enum so one object is both the optimistic workspace patch and the mutation input;
// the enum's keys are the shared tier literals, which keeps the GraphqlAiModelTier[tier] lookups total
@@ -27,6 +27,7 @@ type WorkspaceAiModelSettingsChanges = Partial<
>;
export const useSettingsAiModelsActions = () => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const [currentWorkspace, setCurrentWorkspace] = useAtomState(
currentWorkspaceState,
diff --git a/packages/twenty-front/src/pages/settings/applications/SettingsApplicationCommandMenuItemDetail.tsx b/packages/twenty-front/src/pages/settings/applications/SettingsApplicationCommandMenuItemDetail.tsx
index bacf7ca4dc1..b1578f3400e 100644
--- a/packages/twenty-front/src/pages/settings/applications/SettingsApplicationCommandMenuItemDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/SettingsApplicationCommandMenuItemDetail.tsx
@@ -2,14 +2,15 @@ import { SettingsPageContainer } from '@/settings/components/SettingsPageContain
import { SettingsSectionSkeletonLoader } from '@/settings/components/SettingsSectionSkeletonLoader';
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useParams } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
import { FindOneApplicationDocument } from '~/generated-metadata/graphql';
import { SettingsApplicationCommandMenuItemSettingsTab } from '~/pages/settings/applications/tabs/SettingsApplicationCommandMenuItemSettingsTab';
+import { useLingui } from '@lingui/react/macro';
export const SettingsApplicationCommandMenuItemDetail = () => {
+ const { t } = useLingui();
const { applicationId = '', commandMenuItemId = '' } = useParams<{
applicationId: string;
commandMenuItemId: string;
diff --git a/packages/twenty-front/src/pages/settings/applications/SettingsApplicationDetails.tsx b/packages/twenty-front/src/pages/settings/applications/SettingsApplicationDetails.tsx
index 0f655d194ef..1bb2723f475 100644
--- a/packages/twenty-front/src/pages/settings/applications/SettingsApplicationDetails.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/SettingsApplicationDetails.tsx
@@ -13,7 +13,6 @@ import { SettingsSectionSkeletonLoader } from '@/settings/components/SettingsSec
import { useSettingsActiveTabId } from '@/settings/components/layout/useSettingsActiveTabId';
import type { SingleTabProps } from '@/ui/layout/tab-list/types/SingleTabProps';
import { useMutation, useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useCallback } from 'react';
import {
Navigate,
@@ -66,10 +65,12 @@ import { hasApplicationUpdate } from '@/settings/applications/utils/hasApplicati
import { isUuidFormat } from '~/pages/settings/applications/utils/isUuidFormat';
import { getMissingRequiredApplicationVariables } from '@/settings/applications/utils/getMissingRequiredApplicationVariables';
import { getSettingsMenuItemDisplayTitle } from '~/pages/settings/applications/utils/getSettingsMenuItemDisplayTitle';
+import { useLingui } from '@lingui/react/macro';
const APPLICATION_DETAIL_ID = 'application-detail-id';
export const SettingsApplicationDetails = () => {
+ const { t } = useLingui();
const { applicationId = '' } = useParams<{ applicationId: string }>();
const { getIcon } = useIcons();
const builtInAccountApp = useInstalledBuiltInAccountApp(applicationId);
diff --git a/packages/twenty-front/src/pages/settings/applications/SettingsApplicationFrontComponentDetail.tsx b/packages/twenty-front/src/pages/settings/applications/SettingsApplicationFrontComponentDetail.tsx
index 41554846523..5a06a434bc0 100644
--- a/packages/twenty-front/src/pages/settings/applications/SettingsApplicationFrontComponentDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/SettingsApplicationFrontComponentDetail.tsx
@@ -5,7 +5,6 @@ import { SettingsTabBar } from '@/settings/components/layout/SettingsTabBar';
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useParams } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
@@ -13,10 +12,12 @@ import { IconEye, IconSettings } from 'twenty-ui/icon';
import { FindOneApplicationDocument } from '~/generated-metadata/graphql';
import { SettingsApplicationFrontComponentPreviewTab } from '~/pages/settings/applications/tabs/SettingsApplicationFrontComponentPreviewTab';
import { SettingsApplicationFrontComponentSettingsTab } from '~/pages/settings/applications/tabs/SettingsApplicationFrontComponentSettingsTab';
+import { useLingui } from '@lingui/react/macro';
const FRONT_COMPONENT_DETAIL_ID = 'application-front-component-detail';
export const SettingsApplicationFrontComponentDetail = () => {
+ const { t } = useLingui();
const { applicationId = '', frontComponentId = '' } = useParams<{
applicationId: string;
frontComponentId: string;
diff --git a/packages/twenty-front/src/pages/settings/applications/SettingsApplicationTimelineActivityTypeDetail.tsx b/packages/twenty-front/src/pages/settings/applications/SettingsApplicationTimelineActivityTypeDetail.tsx
index fbd0e54d406..74f02e704a5 100644
--- a/packages/twenty-front/src/pages/settings/applications/SettingsApplicationTimelineActivityTypeDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/SettingsApplicationTimelineActivityTypeDetail.tsx
@@ -5,7 +5,6 @@ import { SettingsSectionSkeletonLoader } from '@/settings/components/SettingsSec
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useParams } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
@@ -13,8 +12,10 @@ import { FindOneApplicationDocument } from '~/generated-metadata/graphql';
import { useApplicationTimelineActivityTypes } from '~/pages/settings/applications/hooks/useApplicationTimelineActivityTypes';
import { SettingsApplicationTimelineActivityTypeSettingsTab } from '~/pages/settings/applications/tabs/SettingsApplicationTimelineActivityTypeSettingsTab';
import { getSettingsApplicationTimelineActivityTypes } from '~/pages/settings/applications/utils/getSettingsApplicationTimelineActivityTypes';
+import { useLingui } from '@lingui/react/macro';
export const SettingsApplicationTimelineActivityTypeDetail = () => {
+ const { t } = useLingui();
const { applicationId = '', timelineActivityTypeId = '' } = useParams<{
applicationId: string;
timelineActivityTypeId: string;
diff --git a/packages/twenty-front/src/pages/settings/applications/SettingsAvailableApplicationDetails.tsx b/packages/twenty-front/src/pages/settings/applications/SettingsAvailableApplicationDetails.tsx
index 4acb47d88f6..de0bcf02514 100644
--- a/packages/twenty-front/src/pages/settings/applications/SettingsAvailableApplicationDetails.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/SettingsAvailableApplicationDetails.tsx
@@ -18,7 +18,6 @@ import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLay
import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useQuery } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useCallback } from 'react';
import { useParams } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
@@ -39,8 +38,10 @@ import { CUSTOM_APPLICATION_ILLUSTRATIONS } from '@/settings/applications/consta
import { STANDARD_APPLICATION_ILLUSTRATIONS } from '@/settings/applications/constants/StandardApplicationIllustrations';
import { getApplicationLookupStatus } from '~/pages/settings/applications/utils/getApplicationLookupStatus';
import { isUuidFormat } from '~/pages/settings/applications/utils/isUuidFormat';
+import { useLingui } from '@lingui/react/macro';
export const SettingsAvailableApplicationDetails = () => {
+ const { t } = useLingui();
const { availableApplicationId = '' } = useParams<{
availableApplicationId: string;
}>();
diff --git a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDetailAbout.tsx b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDetailAbout.tsx
index 924743b64eb..88b4012278c 100644
--- a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDetailAbout.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDetailAbout.tsx
@@ -5,11 +5,11 @@ import {
} from '@/settings/applications/components/SettingsApplicationAboutSidebar';
import { SettingsApplicationScreenshotGallery } from '@/settings/applications/components/SettingsApplicationScreenshotGallery';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
import { getApplicationDescriptionSummary } from '@/settings/applications/utils/getApplicationDescriptionSummary';
+import { useLingui } from '@lingui/react/macro';
type SettingsApplicationDetailAboutProps = {
applicationId?: string | null;
@@ -142,6 +142,7 @@ export const SettingsApplicationDetailAbout = ({
developerLinks,
onShare,
}: SettingsApplicationDetailAboutProps) => {
+ const { t } = useLingui();
const hasScreenshots = isDefined(screenshots) && screenshots.length > 0;
const descriptionSummary = getApplicationDescriptionSummary(description);
diff --git a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationRegistrationRedirectURIsTable.tsx b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationRegistrationRedirectURIsTable.tsx
index c379d180079..24b45b0cea5 100644
--- a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationRegistrationRedirectURIsTable.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationRegistrationRedirectURIsTable.tsx
@@ -5,11 +5,11 @@ import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { IconButton } from 'twenty-ui/components/input';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { IconX } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SettingsApplicationRegistrationRedirectURIsTableProps = {
redirectUris: string[];
@@ -28,6 +28,7 @@ export const SettingsApplicationRegistrationRedirectURIsTable = ({
redirectUris,
updateRedirectUris,
}: SettingsApplicationRegistrationRedirectURIsTableProps) => {
+ const { t } = useLingui();
return (
<>
{redirectUris.length > 0 && (
diff --git a/packages/twenty-front/src/pages/settings/applications/components/SettingsAvailableApplicationCard.tsx b/packages/twenty-front/src/pages/settings/applications/components/SettingsAvailableApplicationCard.tsx
index ea4095ab257..58b26388883 100644
--- a/packages/twenty-front/src/pages/settings/applications/components/SettingsAvailableApplicationCard.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/components/SettingsAvailableApplicationCard.tsx
@@ -4,7 +4,6 @@ import {
StyledSettingsCardTitle,
} from '@/settings/components/SettingsOptions/SettingsCardContentBase';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { Link } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
@@ -15,6 +14,7 @@ import { themeCssVariables } from 'twenty-ui/theme';
import { type MarketplaceApp } from '~/generated-metadata/graphql';
import { getApplicationDescriptionSummary } from '@/settings/applications/utils/getApplicationDescriptionSummary';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
+import { useLingui } from '@lingui/react/macro';
type SettingsAvailableApplicationCardProps = {
application: MarketplaceApp;
@@ -62,6 +62,7 @@ const StyledDescription = styled.div`
export const SettingsAvailableApplicationCard = ({
application,
}: SettingsAvailableApplicationCardProps) => {
+ const { t } = useLingui();
const descriptionSummary = getApplicationDescriptionSummary(
application.description,
);
diff --git a/packages/twenty-front/src/pages/settings/applications/hooks/useApplicationTimelineActivityTypes.ts b/packages/twenty-front/src/pages/settings/applications/hooks/useApplicationTimelineActivityTypes.ts
index e716fd335a3..30f37da3b4f 100644
--- a/packages/twenty-front/src/pages/settings/applications/hooks/useApplicationTimelineActivityTypes.ts
+++ b/packages/twenty-front/src/pages/settings/applications/hooks/useApplicationTimelineActivityTypes.ts
@@ -1,5 +1,4 @@
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { useToast } from 'twenty-ui/components/feedback';
import {
@@ -7,12 +6,14 @@ import {
UpdateTimelineActivityTypeIsActiveDocument,
} from '~/generated-metadata/graphql';
import { useInstalledTimelineActivityTypes } from '~/pages/settings/applications/hooks/useInstalledTimelineActivityTypes';
+import { useLingui } from '@lingui/react/macro';
export const useApplicationTimelineActivityTypes = ({
isInstalledApplication,
}: {
isInstalledApplication: boolean;
}) => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const [mutatingTimelineActivityTypeIds, setMutatingTimelineActivityTypeIds] =
useState<ReadonlySet<string>>(new Set());
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationAutoUpdateSection.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationAutoUpdateSection.tsx
index 74bea214485..2f7e736a630 100644
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationAutoUpdateSection.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationAutoUpdateSection.tsx
@@ -1,12 +1,12 @@
import { SettingsOptionCardContentSwitch } from '@/settings/components/SettingsOptions/SettingsOptionCardContentSwitch';
import { useMutation } from '@apollo/client/react';
-import { t } from '@lingui/core/macro';
import { useToast } from 'twenty-ui/components/feedback';
import { Section } from 'twenty-ui/components/layout';
import { IconRefresh } from 'twenty-ui/icon';
import { Card } from 'twenty-ui/primitives/surfaces';
import { UpdateApplicationDocument } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const SettingsApplicationAutoUpdateSection = ({
applicationId,
@@ -15,6 +15,7 @@ export const SettingsApplicationAutoUpdateSection = ({
applicationId: string;
autoUpgrade: boolean;
}) => {
+ const { t } = useLingui();
const { enqueueToast } = useToast();
const [updateApplication] = useMutation(UpdateApplicationDocument);
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationCommandMenuItemSettingsTab.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationCommandMenuItemSettingsTab.tsx
index 955f9edc239..d6e69826087 100644
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationCommandMenuItemSettingsTab.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationCommandMenuItemSettingsTab.tsx
@@ -4,10 +4,10 @@ import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { TableSection } from '@/ui/layout/table/components/TableSection';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { Section } from 'twenty-ui/components/layout';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SettingsApplicationCommandMenuItemSettingsTabProps = {
label: string;
@@ -53,6 +53,7 @@ export const SettingsApplicationCommandMenuItemSettingsTab = ({
createdAt,
updatedAt,
}: SettingsApplicationCommandMenuItemSettingsTabProps) => {
+ const { t } = useLingui();
const detailRows: { key: string; label: string; value: ReactNode }[] = [
{
key: 'label',
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationDetailGeneralTab.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationDetailGeneralTab.tsx
index 702db6da2d6..230f4287f7d 100644
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationDetailGeneralTab.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationDetailGeneralTab.tsx
@@ -3,7 +3,6 @@ import { SettingsApplicationOverviewCard } from '@/settings/applications/compone
import { SettingsApplicationUninstallButton } from '@/settings/applications/components/SettingsApplicationUninstallButton';
import { SettingsApplicationIframeMediaPermissionsSection } from '@/settings/applications/components/SettingsApplicationIframeMediaPermissionsSection';
import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
-import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { SettingsPath } from 'twenty-shared/types';
import { isNonEmptyArray } from 'twenty-shared/utils';
@@ -20,6 +19,7 @@ import { SettingsApplicationConnectionsSection } from '~/pages/settings/applicat
import { SettingsApplicationFunctionDomainSection } from '~/pages/settings/applications/tabs/SettingsApplicationFunctionDomainSection';
import { applicationHasHttpTriggeredFunctions } from '~/pages/settings/applications/utils/applicationHasHttpTriggeredFunctions';
import { isUpgradableApplicationSourceType } from '@/settings/applications/utils/isUpgradableApplicationSourceType';
+import { useLingui } from '@lingui/react/macro';
type SettingsApplicationDetailGeneralTabProps = {
application: Pick<
@@ -65,6 +65,7 @@ export const SettingsApplicationDetailGeneralTab = ({
isUninstalling,
uninstallProgress,
}: SettingsApplicationDetailGeneralTabProps) => {
+ const { t } = useLingui();
const navigateSettings = useNavigateSettings();
const canManageApplications = useHasPermissionFlag(
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationFrontComponentPreviewTab.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationFrontComponentPreviewTab.tsx
index ea637f1c2fd..08918371108 100644
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationFrontComponentPreviewTab.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationFrontComponentPreviewTab.tsx
@@ -1,10 +1,10 @@
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Suspense, lazy } from 'react';
import { Section } from 'twenty-ui/components/layout';
import { themeCssVariables } from 'twenty-ui/theme';
import { FrontComponentSkeletonLoader } from '@/front-components/components/FrontComponentSkeletonLoader';
+import { useLingui } from '@lingui/react/macro';
const FrontComponentRenderer = lazy(() =>
import('@/front-components/components/FrontComponentRenderer').then(
@@ -56,6 +56,7 @@ export const SettingsApplicationFrontComponentPreviewTab = ({
frontComponentId,
isHeadless,
}: SettingsApplicationFrontComponentPreviewTabProps) => {
+ const { t } = useLingui();
return (
<Section.Root>
<StyledPreviewFrame>
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationFrontComponentSettingsTab.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationFrontComponentSettingsTab.tsx
index d5532ec61f5..4fbe22c4b22 100644
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationFrontComponentSettingsTab.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationFrontComponentSettingsTab.tsx
@@ -4,10 +4,10 @@ import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { TableSection } from '@/ui/layout/table/components/TableSection';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { Section } from 'twenty-ui/components/layout';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
type SettingsApplicationFrontComponentSettingsTabProps = {
description?: string | null;
@@ -56,6 +56,7 @@ export const SettingsApplicationFrontComponentSettingsTab = ({
createdAt,
updatedAt,
}: SettingsApplicationFrontComponentSettingsTabProps) => {
+ const { t } = useLingui();
const trimmedDescription = description?.trim();
const detailRows: { key: string; label: string; value: ReactNode }[] = [
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationTimelineActivityTypeSettingsTab.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationTimelineActivityTypeSettingsTab.tsx
index ff3ca5e6fad..43ffd41e40c 100644
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationTimelineActivityTypeSettingsTab.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationTimelineActivityTypeSettingsTab.tsx
@@ -5,7 +5,6 @@ import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { TableSection } from '@/ui/layout/table/components/TableSection';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { Section } from 'twenty-ui/components/layout';
import { Button } from 'twenty-ui/primitives/input';
@@ -13,6 +12,7 @@ import { IconRestore, IconTimelineEvent } from 'twenty-ui/icon';
import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
import { type SettingsApplicationTimelineActivityType } from '~/pages/settings/applications/types/SettingsApplicationTimelineActivityType';
+import { useLingui } from '@lingui/react/macro';
type SettingsApplicationTimelineActivityTypeSettingsTabProps = {
timelineActivityType: SettingsApplicationTimelineActivityType;
@@ -40,6 +40,7 @@ export const SettingsApplicationTimelineActivityTypeSettingsTab = ({
onIsActiveChange,
onReset,
}: SettingsApplicationTimelineActivityTypeSettingsTabProps) => {
+ const { t } = useLingui();
const detailRows: { key: string; label: string; value: ReactNode }[] = [
{
key: 'label',
diff --git a/packages/twenty-front/src/pages/settings/billing/SettingsUsageUserDetail.tsx b/packages/twenty-front/src/pages/settings/billing/SettingsUsageUserDetail.tsx
index 54e7e5ae55d..7f4b83a1c53 100644
--- a/packages/twenty-front/src/pages/settings/billing/SettingsUsageUserDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/billing/SettingsUsageUserDetail.tsx
@@ -9,7 +9,6 @@ import { useUsageAnalyticsData } from '@/settings/usage/hooks/useUsageAnalyticsD
import { useUsageValueFormatter } from '@/settings/usage/hooks/useUsageValueFormatter';
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Trans, useLingui } from '@lingui/react/macro';
import { useParams } from 'react-router-dom';
@@ -43,6 +42,7 @@ const StyledUserCredits = styled.span`
`;
export const SettingsUsageUserDetail = () => {
+ const { t } = useLingui();
const { t: tLingui } = useLingui();
const { userWorkspaceId } = useParams<{ userWorkspaceId: string }>();
const { formatUsageValue } = useUsageValueFormatter();
diff --git a/packages/twenty-front/src/pages/settings/community/SettingsCommunity.tsx b/packages/twenty-front/src/pages/settings/community/SettingsCommunity.tsx
index e01efa249ae..57bb9721832 100644
--- a/packages/twenty-front/src/pages/settings/community/SettingsCommunity.tsx
+++ b/packages/twenty-front/src/pages/settings/community/SettingsCommunity.tsx
@@ -4,7 +4,6 @@ import { SettingsPageContainer } from '@/settings/components/SettingsPageContain
import { SettingsLabContent } from '@/settings/lab/components/SettingsLabContent';
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { Section } from 'twenty-ui/components/layout';
import {
IconBrandX,
@@ -18,6 +17,7 @@ import { getSettingsPath } from 'twenty-shared/utils';
import { MOBILE_VIEWPORT, useTheme, themeCssVariables } from 'twenty-ui/theme';
import coverDark from '~/pages/settings/community/assets/cover-dark.png';
import coverLight from '~/pages/settings/community/assets/cover-light.png';
+import { useLingui } from '@lingui/react/macro';
const SETTINGS_COMMUNITY_HERO_INSTANCE_ID_PREFIX = 'settings-community-hero';
@@ -44,6 +44,7 @@ type SettingsCommunityLink = {
};
export const SettingsCommunity = () => {
+ const { t } = useLingui();
const theme = useTheme();
const { getIcon } = useIcons();
const IconBrandDiscord = getIcon('IconBrandDiscord');
diff --git a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectOverview.tsx b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectOverview.tsx
index 3077513b801..4e72e72b6c5 100644
--- a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectOverview.tsx
+++ b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectOverview.tsx
@@ -2,11 +2,12 @@ import { ReactFlowProvider } from '@xyflow/react';
import { SettingsDataModelOverview } from '@/settings/data-model/graph-overview/components/SettingsDataModelOverview';
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
+import { useLingui } from '@lingui/react/macro';
export const SettingsObjectOverview = () => {
+ const { t } = useLingui();
return (
<SettingsPageLayout
links={[
diff --git a/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldSelect.tsx b/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldSelect.tsx
index 76acfe24e8d..9d1f1bd6231 100644
--- a/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldSelect.tsx
+++ b/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldSelect.tsx
@@ -9,7 +9,6 @@ import { type FieldType } from '@/settings/data-model/types/FieldType';
import { settingsDataModelFieldTypeFormSchema } from '@/settings/data-model/fields/forms/validation-schemas/settingsDataModelFieldTypeFormSchema';
import { useWorkspaceSurface } from '@/ui/layout/hooks/useWorkspaceSurface';
import { zodResolver } from '@hookform/resolvers/zod';
-import { t } from '@lingui/core/macro';
import { useEffect } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import { useParams } from 'react-router-dom';
@@ -18,8 +17,10 @@ import { getSettingsPath, isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
import { FieldMetadataType } from '~/generated-metadata/graphql';
import { useNavigateApp } from '~/hooks/useNavigateApp';
+import { useLingui } from '@lingui/react/macro';
export const SettingsObjectNewFieldSelect = () => {
+ const { t } = useLingui();
const navigate = useNavigateApp();
const workspaceSurface = useWorkspaceSurface();
const { objectNamePlural = '' } = useParams();
diff --git a/packages/twenty-front/src/pages/settings/layout/SettingsLayoutPageLayoutDetail.tsx b/packages/twenty-front/src/pages/settings/layout/SettingsLayoutPageLayoutDetail.tsx
index 8f37e78432c..a4b6827d4d6 100644
--- a/packages/twenty-front/src/pages/settings/layout/SettingsLayoutPageLayoutDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/layout/SettingsLayoutPageLayoutDetail.tsx
@@ -1,6 +1,5 @@
import { objectMetadataItemsSelector } from '@/object-metadata/states/objectMetadataItemsSelector';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { useParams } from 'react-router-dom';
import { isDefined } from 'twenty-shared/utils';
import { useApplicationManifest } from '~/pages/settings/layout/hooks/useApplicationManifest';
@@ -9,8 +8,10 @@ import {
SettingsLayoutDetailScaffold,
} from '~/pages/settings/layout/components/SettingsLayoutDetailScaffold';
import { SettingsLayoutItemTable } from '~/pages/settings/layout/components/SettingsLayoutItemTable';
+import { useLingui } from '@lingui/react/macro';
export const SettingsLayoutPageLayoutDetail = () => {
+ const { t } = useLingui();
const { applicationId = '', pageLayoutUniversalIdentifier = '' } = useParams<{
applicationId: string;
pageLayoutUniversalIdentifier: string;
diff --git a/packages/twenty-front/src/pages/settings/layout/SettingsLayoutViewDetail.tsx b/packages/twenty-front/src/pages/settings/layout/SettingsLayoutViewDetail.tsx
index 6591427d2a6..50dbd2fb33b 100644
--- a/packages/twenty-front/src/pages/settings/layout/SettingsLayoutViewDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/layout/SettingsLayoutViewDetail.tsx
@@ -1,7 +1,6 @@
import { flattenedFieldMetadataItemsSelector } from '@/object-metadata/states/flattenedFieldMetadataItemsSelector';
import { objectMetadataItemsSelector } from '@/object-metadata/states/objectMetadataItemsSelector';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { useParams } from 'react-router-dom';
import { isDefined } from 'twenty-shared/utils';
import { useApplicationManifest } from '~/pages/settings/layout/hooks/useApplicationManifest';
@@ -10,6 +9,7 @@ import {
SettingsLayoutDetailScaffold,
} from '~/pages/settings/layout/components/SettingsLayoutDetailScaffold';
import { SettingsLayoutItemTable } from '~/pages/settings/layout/components/SettingsLayoutItemTable';
+import { useLingui } from '@lingui/react/macro';
const formatFilterValue = (value: unknown): string => {
if (typeof value === 'string') return value;
@@ -20,6 +20,7 @@ const formatFilterValue = (value: unknown): string => {
};
export const SettingsLayoutViewDetail = () => {
+ const { t } = useLingui();
const { applicationId = '', viewUniversalIdentifier = '' } = useParams<{
applicationId: string;
viewUniversalIdentifier: string;
diff --git a/packages/twenty-front/src/pages/settings/layout/components/SettingsLayoutDetailScaffold.tsx b/packages/twenty-front/src/pages/settings/layout/components/SettingsLayoutDetailScaffold.tsx
index dac3be9603c..cc413645a11 100644
--- a/packages/twenty-front/src/pages/settings/layout/components/SettingsLayoutDetailScaffold.tsx
+++ b/packages/twenty-front/src/pages/settings/layout/components/SettingsLayoutDetailScaffold.tsx
@@ -7,12 +7,12 @@ import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
import { themeCssVariables } from 'twenty-ui/theme';
+import { useLingui } from '@lingui/react/macro';
export type DetailRow = { key: string; label: string; value: ReactNode };
@@ -46,6 +46,7 @@ export const SettingsLayoutDetailScaffold = ({
isLoading: boolean;
children?: ReactNode;
}) => {
+ const { t } = useLingui();
const trimmedDescription = description?.trim();
const applicationContentHref = getSettingsPath(
diff --git a/packages/twenty-front/src/pages/settings/logic-functions/SettingsLogicFunctionDetail.tsx b/packages/twenty-front/src/pages/settings/logic-functions/SettingsLogicFunctionDetail.tsx
index 931b4e486a2..876cfe51172 100644
--- a/packages/twenty-front/src/pages/settings/logic-functions/SettingsLogicFunctionDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/logic-functions/SettingsLogicFunctionDetail.tsx
@@ -10,7 +10,6 @@ import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLay
import { SettingsTabBar } from '@/settings/components/layout/SettingsTabBar';
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
import {
@@ -25,10 +24,12 @@ import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { SettingsLogicFunctionCodeEditorTab } from '@/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab';
import { useExecuteLogicFunction } from '@/logic-functions/hooks/useExecuteLogicFunction';
+import { useLingui } from '@lingui/react/macro';
const LOGIC_FUNCTION_DETAIL_ID = 'logic-function-detail';
export const SettingsLogicFunctionDetail = () => {
+ const { t } = useLingui();
const { logicFunctionId = '', applicationId } = useParams();
const location = useLocation();
diff --git a/packages/twenty-front/src/pages/settings/members/SettingsWorkspaceMember.tsx b/packages/twenty-front/src/pages/settings/members/SettingsWorkspaceMember.tsx
index 4c9f6f53a1b..a6e5700aa04 100644
--- a/packages/twenty-front/src/pages/settings/members/SettingsWorkspaceMember.tsx
+++ b/packages/twenty-front/src/pages/settings/members/SettingsWorkspaceMember.tsx
@@ -13,7 +13,6 @@ import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { t } from '@lingui/core/macro';
import { CoreObjectNameSingular, SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
@@ -34,6 +33,7 @@ import {
ImpersonateDocument,
PermissionFlagType,
} from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
const SETTINGS_WORKSPACE_MEMBER_TABS = {
COMPONENT_INSTANCE_ID: 'settings-workspace-member-tabs',
@@ -46,6 +46,7 @@ const SETTINGS_WORKSPACE_MEMBER_TABS = {
const DELETE_MEMBER_MODAL_ID = 'workspace-member-delete-modal';
export const SettingsWorkspaceMember = () => {
+ const { t } = useLingui();
const { workspaceMemberId = '' } = useParams();
const navigateSettings = useNavigateSettings();
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/pages/settings/members/roles/SettingsRoleAddObjectLevel.tsx b/packages/twenty-front/src/pages/settings/members/roles/SettingsRoleAddObjectLevel.tsx
index 2045775b8a0..598204e4cd4 100644
--- a/packages/twenty-front/src/pages/settings/members/roles/SettingsRoleAddObjectLevel.tsx
+++ b/packages/twenty-front/src/pages/settings/members/roles/SettingsRoleAddObjectLevel.tsx
@@ -7,15 +7,16 @@ import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDr
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
import { SettingsWizardStepBar } from '@/settings/components/layout/SettingsWizardStepBar';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
-import { t } from '@lingui/core/macro';
import { Navigate, useParams, useSearchParams } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
import { useQuery } from '@apollo/client/react';
import { FindOneAgentDocument } from '~/generated-metadata/graphql';
+import { useLingui } from '@lingui/react/macro';
export const SettingsRoleAddObjectLevel = () => {
+ const { t } = useLingui();
const { roleId } = useParams();
const [searchParams] = useSearchParams();
const fromAgentId = searchParams.get('fromAgent');
diff --git a/packages/twenty-front/src/pages/settings/security/SettingsSecuritySsoIdentifyProvider.tsx b/packages/twenty-front/src/pages/settings/security/SettingsSecuritySsoIdentifyProvider.tsx
index ac28b384ace..a0cb85c6e40 100644
--- a/packages/twenty-front/src/pages/settings/security/SettingsSecuritySsoIdentifyProvider.tsx
+++ b/packages/twenty-front/src/pages/settings/security/SettingsSecuritySsoIdentifyProvider.tsx
@@ -9,8 +9,7 @@ import { type SettingSecurityNewSsoIdentityFormValues } from '@/settings/securit
import { ssoIdentityProviderDefaultValues } from '@/settings/security/utils/ssoIdentityProviderDefaultValues';
import { ssoIdentitiesProvidersParamsSchema } from '@/settings/security/validation-schemas/ssoIdentityProviderSchema';
import { zodResolver } from '@hookform/resolvers/zod';
-import { t } from '@lingui/core/macro';
-import { Trans } from '@lingui/react/macro';
+import { Trans, useLingui } from '@lingui/react/macro';
import { FormProvider, useForm } from 'react-hook-form';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
@@ -18,6 +17,7 @@ import { useToast } from 'twenty-ui/components/feedback';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
export const SettingsSecuritySsoIdentifyProvider = () => {
+ const { t } = useLingui();
const navigate = useNavigateSettings();
const { enqueueToast } = useToast();
diff --git a/packages/twenty-front/src/utils/i18n/__tests__/dynamicActivate.test.ts b/packages/twenty-front/src/utils/i18n/__tests__/dynamicActivate.test.ts
index 453b484a2a9..470a599c9db 100644
--- a/packages/twenty-front/src/utils/i18n/__tests__/dynamicActivate.test.ts
+++ b/packages/twenty-front/src/utils/i18n/__tests__/dynamicActivate.test.ts
@@ -1,3 +1,5 @@
+import { i18n } from '@lingui/core';
+
import { dynamicActivate } from '~/utils/i18n/dynamicActivate';
describe('dynamicActivate', () => {
@@ -16,6 +18,51 @@ describe('dynamicActivate', () => {
expect(document.documentElement.lang).toBe('fr-FR');
});
+ it('keeps the document attributes in sync when the locale is already active', async () => {
+ await dynamicActivate('he-IL');
+ document.documentElement.lang = '';
+ document.documentElement.dir = '';
+
+ await dynamicActivate('he-IL');
+
+ expect(document.documentElement.lang).toBe('he-IL');
+ expect(document.documentElement.dir).toBe('rtl');
+ });
+
+ it('does not notify listeners when the locale is already active', async () => {
+ await dynamicActivate('fr-FR');
+ const onChange = jest.fn();
+ const unsubscribe = i18n.on('change', onChange);
+
+ await dynamicActivate('fr-FR');
+
+ unsubscribe();
+ expect(onChange).not.toHaveBeenCalled();
+ });
+
+ it('activates once when the same locale is requested twice concurrently', async () => {
+ await dynamicActivate('en');
+ const onChange = jest.fn();
+ const unsubscribe = i18n.on('change', onChange);
+
+ await Promise.all([dynamicActivate('de-DE'), dynamicActivate('de-DE')]);
+
+ unsubscribe();
+ expect(i18n.locale).toBe('de-DE');
+ expect(onChange).toHaveBeenCalledTimes(2);
+ });
+
+ it('keeps the latest requested locale when an earlier activation resolves last', async () => {
+ await dynamicActivate('en');
+
+ const pendingFrench = dynamicActivate('fr-FR');
+ await dynamicActivate('en');
+ await pendingFrench;
+
+ expect(i18n.locale).toBe('en');
+ expect(document.documentElement.lang).toBe('en');
+ });
+
it('falls back to the source locale for an unknown one', async () => {
await dynamicActivate('zz-ZZ' as 'en');
diff --git a/packages/twenty-front/src/utils/i18n/dynamicActivate.ts b/packages/twenty-front/src/utils/i18n/dynamicActivate.ts
index 5e743de3ee6..542330a54f3 100644
--- a/packages/twenty-front/src/utils/i18n/dynamicActivate.ts
+++ b/packages/twenty-front/src/utils/i18n/dynamicActivate.ts
@@ -5,16 +5,40 @@ import {
SOURCE_LOCALE,
} from 'twenty-shared/translations';
+let latestRequestedLocale: keyof typeof APP_LOCALES | undefined;
+
+const applyDocumentLocale = (locale: keyof typeof APP_LOCALES) => {
+ document.documentElement.lang = locale;
+ document.documentElement.dir = getLocaleTextDirection(locale);
+};
+
export const dynamicActivate = async (locale: keyof typeof APP_LOCALES) => {
if (!Object.values(APP_LOCALES).includes(locale)) {
// oxlint-disable-next-line no-console
console.warn(`Invalid locale "${locale}", defaulting to "en"`);
locale = SOURCE_LOCALE;
}
+
+ latestRequestedLocale = locale;
+
+ // load() and activate() always emit "change", which hands every useLingui consumer a new t
+ if (i18n.locale === locale) {
+ applyDocumentLocale(locale);
+ return;
+ }
+
const { messages } = await import(`../../locales/generated/${locale}.ts`);
+
+ if (latestRequestedLocale !== locale) {
+ return;
+ }
+
+ if (i18n.locale === locale) {
+ applyDocumentLocale(locale);
+ return;
+ }
+
i18n.load(locale, messages);
i18n.activate(locale);
-
- document.documentElement.lang = locale;
- document.documentElement.dir = getLocaleTextDirection(locale);
+ applyDocumentLocale(locale);
};