Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

feat(i18n): translate remaining Atomic CRM UI copy

Anibal Svarcas97e7a373a759
diff --git a/src/components/atomic-crm/companies/CompanyAside.tsx b/src/components/atomic-crm/companies/CompanyAside.tsx
index dba82c04..c4d26d8d 100644
--- a/src/components/atomic-crm/companies/CompanyAside.tsx
+++ b/src/components/atomic-crm/companies/CompanyAside.tsx
@@ -1,5 +1,5 @@
import { Globe, Linkedin, Phone } from "lucide-react";
-import { useRecordContext } from "ra-core";
+import { useRecordContext, useTranslate } from "ra-core";
import { EditButton } from "@/components/admin/edit-button";
import { DeleteButton } from "@/components/admin/delete-button";
import { ReferenceField } from "@/components/admin/reference-field";
@@ -21,15 +21,24 @@ interface CompanyAsideProps {
export const CompanyAside = ({ link = "edit" }: CompanyAsideProps) => {
const record = useRecordContext<Company>();
+ const translate = useTranslate();
if (!record) return null;
return (
<div className="hidden sm:block w-92 min-w-92 space-y-4">
<div className="flex flex-row space-x-1">
{link === "edit" ? (
- <EditButton label="Edit Company" />
+ <EditButton
+ label={translate("crm.companies.action.edit", {
+ _: "Edit company",
+ })}
+ />
) : (
- <ShowButton label="Show Company" />
+ <ShowButton
+ label={translate("crm.companies.action.show", {
+ _: "Show company",
+ })}
+ />
)}
</div>
@@ -54,12 +63,17 @@ export const CompanyAside = ({ link = "edit" }: CompanyAsideProps) => {
};
export const CompanyInfo = ({ record }: { record: Company }) => {
+ const translate = useTranslate();
if (!record.website && !record.linkedin_url && !record.phone_number) {
return null;
}
return (
- <AsideSection title="Company Info">
+ <AsideSection
+ title={translate("crm.companies.aside.company_info", {
+ _: "Company info",
+ })}
+ >
{record.website && (
<div className="flex flex-row items-center gap-1 min-h-[24px]">
<Globe className="w-4 h-4" />
@@ -99,6 +113,7 @@ export const CompanyInfo = ({ record }: { record: Company }) => {
export const ContextInfo = ({ record }: { record: Company }) => {
const { companySectors } = useConfigurationContext();
+ const translate = useTranslate();
if (!record.revenue && !record.id) {
return null;
}
@@ -108,21 +123,31 @@ export const ContextInfo = ({ record }: { record: Company }) => {
)?.label;
return (
- <AsideSection title="Context">
- {sectorLabel && <span>Sector: {sectorLabel}</span>}
+ <AsideSection title={translate("crm.companies.aside.context", { _: "Context" })}>
+ {sectorLabel && (
+ <span>
+ {translate("crm.companies.fields.sector", { _: "Sector" })}:{" "}
+ {sectorLabel}
+ </span>
+ )}
{record.size && (
<span>
- Size: <SelectField source="size" choices={sizes} />
+ {translate("crm.companies.fields.size", { _: "Size" })}:{" "}
+ <SelectField source="size" choices={sizes} />
</span>
)}
{record.revenue && (
<span>
- Revenue: <TextField source="revenue" />
+ {translate("crm.companies.fields.revenue", { _: "Revenue" })}:{" "}
+ <TextField source="revenue" />
</span>
)}
{record.tax_identifier && (
<span>
- Tax Identifier: <TextField source="tax_identifier" />
+ {translate("crm.companies.fields.tax_identifier", {
+ _: "Tax Identifier",
+ })}
+ : <TextField source="tax_identifier" />
</span>
)}
</AsideSection>
@@ -130,6 +155,7 @@ export const ContextInfo = ({ record }: { record: Company }) => {
};
export const AddressInfo = ({ record }: { record: Company }) => {
+ const translate = useTranslate();
if (
!record.address &&
!record.city &&
@@ -140,7 +166,12 @@ export const AddressInfo = ({ record }: { record: Company }) => {
}
return (
- <AsideSection title="Main Address" noGap>
+ <AsideSection
+ title={translate("crm.companies.aside.main_address", {
+ _: "Main address",
+ })}
+ noGap
+ >
<TextField source="address" />
<TextField source="city" />
<TextField source="zipcode" />
@@ -151,6 +182,7 @@ export const AddressInfo = ({ record }: { record: Company }) => {
};
export const AdditionalInfo = ({ record }: { record: Company }) => {
+ const translate = useTranslate();
if (
!record.created_at &&
!record.sales_id &&
@@ -165,7 +197,11 @@ export const AdditionalInfo = ({ record }: { record: Company }) => {
};
return (
- <AsideSection title="Additional Info">
+ <AsideSection
+ title={translate("crm.companies.aside.additional_info", {
+ _: "Additional info",
+ })}
+ >
{record.description && (
<p className="text-sm mb-1">{record.description}</p>
)}
@@ -189,7 +225,10 @@ export const AdditionalInfo = ({ record }: { record: Company }) => {
)}
{record.sales_id !== null && (
<div className="inline-flex text-sm text-muted-foreground mb-1">
- Followed by&nbsp;
+ {translate("crm.contacts.background.followed_by", {
+ _: "Followed by",
+ })}
+ &nbsp;
<ReferenceField source="sales_id" reference="sales" record={record}>
<SaleName />
</ReferenceField>
@@ -197,7 +236,7 @@ export const AdditionalInfo = ({ record }: { record: Company }) => {
)}
{record.created_at && (
<p className="text-sm text-muted-foreground mb-1">
- Added on{" "}
+ {translate("crm.contacts.background.added_on", { _: "Added on" })}{" "}
<DateField
source="created_at"
record={record}
diff --git a/src/components/atomic-crm/companies/CompanyCreate.tsx b/src/components/atomic-crm/companies/CompanyCreate.tsx
index ab01c4cb..f8ad3bf9 100644
--- a/src/components/atomic-crm/companies/CompanyCreate.tsx
+++ b/src/components/atomic-crm/companies/CompanyCreate.tsx
@@ -1,4 +1,4 @@
-import { CreateBase, Form, useGetIdentity } from "ra-core";
+import { CreateBase, Form, useGetIdentity, useTranslate } from "ra-core";
import { Card, CardContent } from "@/components/ui/card";
import { CancelButton } from "@/components/admin/cancel-button";
import { SaveButton } from "@/components/admin/form";
@@ -7,6 +7,7 @@ import { CompanyInputs } from "./CompanyInputs";
export const CompanyCreate = () => {
const { identity } = useGetIdentity();
+ const translate = useTranslate();
return (
<CreateBase
redirect="show"
@@ -29,7 +30,11 @@ export const CompanyCreate = () => {
className="sticky flex pt-4 pb-4 md:pb-0 bottom-0 bg-linear-to-b from-transparent to-card to-10% flex-row justify-end gap-2"
>
<CancelButton />
- <SaveButton label="Create Company" />
+ <SaveButton
+ label={translate("crm.companies.action.create", {
+ _: "Create Company",
+ })}
+ />
</div>
</CardContent>
</Card>
diff --git a/src/components/atomic-crm/companies/CompanyList.tsx b/src/components/atomic-crm/companies/CompanyList.tsx
index fb0d1ce9..c4cdeb56 100644
--- a/src/components/atomic-crm/companies/CompanyList.tsx
+++ b/src/components/atomic-crm/companies/CompanyList.tsx
@@ -1,4 +1,4 @@
-import { useGetIdentity, useListContext } from "ra-core";
+import { useGetIdentity, useListContext, useTranslate } from "ra-core";
import { CreateButton } from "@/components/admin/create-button";
import { ExportButton } from "@/components/admin/export-button";
import { List } from "@/components/admin/list";
@@ -44,11 +44,14 @@ const CompanyListLayout = () => {
};
const CompanyListActions = () => {
+ const translate = useTranslate();
return (
<TopToolbar>
<SortButton fields={["name", "created_at", "nb_contacts"]} />
<ExportButton />
- <CreateButton label="New Company" />
+ <CreateButton
+ label={translate("crm.companies.action.new", { _: "New Company" })}
+ />
</TopToolbar>
);
};
diff --git a/src/components/atomic-crm/companies/CompanyListFilter.tsx b/src/components/atomic-crm/companies/CompanyListFilter.tsx
index 000ab81b..4b2d44bd 100644
--- a/src/components/atomic-crm/companies/CompanyListFilter.tsx
+++ b/src/components/atomic-crm/companies/CompanyListFilter.tsx
@@ -1,5 +1,5 @@
import { Building, Truck, Users } from "lucide-react";
-import { FilterLiveForm, useGetIdentity } from "ra-core";
+import { FilterLiveForm, useGetIdentity, useTranslate } from "ra-core";
import { ToggleFilterButton } from "@/components/admin/toggle-filter-button";
import { SearchInput } from "@/components/admin/search-input";
@@ -10,13 +10,17 @@ import { sizes } from "./sizes";
export const CompanyListFilter = () => {
const { identity } = useGetIdentity();
const { companySectors } = useConfigurationContext();
+ const translate = useTranslate();
return (
<div className="w-52 min-w-52 flex flex-col gap-8">
<FilterLiveForm>
<SearchInput source="q" />
</FilterLiveForm>
- <FilterCategory icon={<Building className="h-4 w-4" />} label="Size">
+ <FilterCategory
+ icon={<Building className="h-4 w-4" />}
+ label={translate("crm.companies.filters.size", { _: "Size" })}
+ >
{sizes.map((size) => (
<ToggleFilterButton
className="w-full justify-between"
@@ -27,7 +31,10 @@ export const CompanyListFilter = () => {
))}
</FilterCategory>
- <FilterCategory icon={<Truck className="h-4 w-4" />} label="Sector">
+ <FilterCategory
+ icon={<Truck className="h-4 w-4" />}
+ label={translate("crm.companies.filters.sector", { _: "Sector" })}
+ >
{companySectors.map((sector) => (
<ToggleFilterButton
className="w-full justify-between"
@@ -40,11 +47,13 @@ export const CompanyListFilter = () => {
<FilterCategory
icon={<Users className="h-4 w-4" />}
- label="Account Manager"
+ label={translate("crm.common.account_manager", {
+ _: "Account manager",
+ })}
>
<ToggleFilterButton
className="w-full justify-between"
- label={"Me"}
+ label={translate("crm.common.me", { _: "Me" })}
value={{ sales_id: identity?.id }}
/>
</FilterCategory>
diff --git a/src/components/atomic-crm/contacts/ContactAside.tsx b/src/components/atomic-crm/contacts/ContactAside.tsx
index 6ec7a0ee..22918d3b 100644
--- a/src/components/atomic-crm/contacts/ContactAside.tsx
+++ b/src/components/atomic-crm/contacts/ContactAside.tsx
@@ -1,4 +1,4 @@
-import { useRecordContext } from "ra-core";
+import { useRecordContext, useTranslate } from "ra-core";
import { EditButton } from "@/components/admin/edit-button";
import { DeleteButton } from "@/components/admin";
import { ReferenceManyField } from "@/components/admin/reference-many-field";
@@ -16,31 +16,50 @@ import { ExportVCardButton } from "./ExportVCardButton";
export const ContactAside = ({ link = "edit" }: { link?: "edit" | "show" }) => {
const record = useRecordContext<Contact>();
+ const translate = useTranslate();
if (!record) return null;
return (
<div className="hidden sm:block w-92 min-w-92 text-sm">
<div className="mb-4 -ml-1">
{link === "edit" ? (
- <EditButton label="Edit Contact" />
+ <EditButton
+ label={translate("crm.contacts.action.edit", {
+ _: "Edit contact",
+ })}
+ />
) : (
- <ShowButton label="Show Contact" />
+ <ShowButton
+ label={translate("crm.contacts.action.show", {
+ _: "Show contact",
+ })}
+ />
)}
</div>
- <AsideSection title="Personal info">
+ <AsideSection
+ title={translate("crm.contacts.inputs.personal_info", {
+ _: "Personal info",
+ })}
+ >
<ContactPersonalInfo />
</AsideSection>
- <AsideSection title="Background info">
+ <AsideSection
+ title={translate("crm.contacts.inputs.background_info_short", {
+ _: "Background info",
+ })}
+ >
<ContactBackgroundInfo />
</AsideSection>
- <AsideSection title="Tags">
+ <AsideSection title={translate("crm.tags.name", { smart_count: 2, _: "Tags" })}>
<TagsListEdit />
</AsideSection>
- <AsideSection title="Tasks">
+ <AsideSection
+ title={translate("crm.tasks.name", { smart_count: 2, _: "Tasks" })}
+ >
<ReferenceManyField
target="contact_id"
reference="tasks"
diff --git a/src/components/atomic-crm/contacts/ContactListFilter.tsx b/src/components/atomic-crm/contacts/ContactListFilter.tsx
index 131875f5..a27acef9 100644
--- a/src/components/atomic-crm/contacts/ContactListFilter.tsx
+++ b/src/components/atomic-crm/contacts/ContactListFilter.tsx
@@ -1,6 +1,6 @@
import { endOfYesterday, startOfMonth, startOfWeek, subMonths } from "date-fns";
import { CheckSquare, Clock, Tag, TrendingUp, Users } from "lucide-react";
-import { useGetIdentity, useGetList, useListContext } from "ra-core";
+import { useGetIdentity, useGetList, useListContext, useTranslate } from "ra-core";
import { ToggleFilterButton } from "@/components/admin/toggle-filter-button";
import { Badge } from "@/components/ui/badge";
@@ -15,17 +15,29 @@ export const ContactListFilter = () => {
const { noteStatuses } = useConfigurationContext();
const isMobile = useIsMobile();
const { identity } = useGetIdentity();
+ const translate = useTranslate();
const { data } = useGetList("tags", {
pagination: { page: 1, perPage: 10 },
sort: { field: "name", order: "ASC" },
});
return (
- <ResponsiveFilters searchInput={{ placeholder: "Search name, company..." }}>
- <FilterCategory label="Last activity" icon={<Clock />}>
+ <ResponsiveFilters
+ searchInput={{
+ placeholder: translate("crm.contacts.filters.search", {
+ _: "Search name, company...",
+ }),
+ }}
+ >
+ <FilterCategory
+ label={translate("crm.contacts.filters.last_activity", {
+ _: "Last activity",
+ })}
+ icon={<Clock />}
+ >
<ToggleFilterButton
className="w-auto md:w-full justify-between h-10 md:h-8"
- label="Today"
+ label={translate("crm.contacts.filters.today", { _: "Today" })}
value={{
"last_seen@gte": endOfYesterday().toISOString(),
"last_seen@lte": undefined,
@@ -34,7 +46,7 @@ export const ContactListFilter = () => {
/>
<ToggleFilterButton
className="w-auto md:w-full justify-between h-10 md:h-8"
- label="This week"
+ label={translate("crm.contacts.filters.this_week", { _: "This week" })}
value={{
"last_seen@gte": startOfWeek(new Date()).toISOString(),
"last_seen@lte": undefined,
@@ -43,7 +55,9 @@ export const ContactListFilter = () => {
/>
<ToggleFilterButton
className="w-auto md:w-full justify-between h-10 md:h-8"
- label="Before this week"
+ label={translate("crm.contacts.filters.before_this_week", {
+ _: "Before this week",
+ })}
value={{
"last_seen@gte": undefined,
"last_seen@lte": startOfWeek(new Date()).toISOString(),
@@ -52,7 +66,9 @@ export const ContactListFilter = () => {
/>
<ToggleFilterButton
className="w-auto md:w-full justify-between h-10 md:h-8"
- label="Before this month"
+ label={translate("crm.contacts.filters.before_this_month", {
+ _: "Before this month",
+ })}
value={{
"last_seen@gte": undefined,
"last_seen@lte": startOfMonth(new Date()).toISOString(),
@@ -61,7 +77,9 @@ export const ContactListFilter = () => {
/>
<ToggleFilterButton
className="w-auto md:w-full justify-between h-10 md:h-8"
- label="Before last month"
+ label={translate("crm.contacts.filters.before_last_month", {
+ _: "Before last month",
+ })}
value={{
"last_seen@gte": undefined,
"last_seen@lte": subMonths(
@@ -73,7 +91,10 @@ export const ContactListFilter = () => {
/>
</FilterCategory>
- <FilterCategory label="Status" icon={<TrendingUp />}>
+ <FilterCategory
+ label={translate("crm.contacts.filters.status", { _: "Status" })}
+ icon={<TrendingUp />}
+ >
{noteStatuses.map((status) => (
<ToggleFilterButton
key={status.value}
@@ -89,7 +110,10 @@ export const ContactListFilter = () => {
))}
</FilterCategory>
- <FilterCategory label="Tags" icon={<Tag />}>
+ <FilterCategory
+ label={translate("crm.contacts.filters.tags", { _: "Tags" })}
+ icon={<Tag />}
+ >
{data &&
data.map((record) => (
<ToggleFilterButton
@@ -112,19 +136,29 @@ export const ContactListFilter = () => {
))}
</FilterCategory>
- <FilterCategory icon={<CheckSquare />} label="Tasks">
+ <FilterCategory
+ icon={<CheckSquare />}
+ label={translate("crm.tasks.name", { smart_count: 2, _: "Tasks" })}
+ >
<ToggleFilterButton
className="w-full justify-between h-10 md:h-8"
- label={"With pending tasks"}
+ label={translate("crm.tasks.filters.with_pending", {
+ _: "With pending tasks",
+ })}
value={{ "nb_tasks@gt": 0 }}
size={isMobile ? "lg" : undefined}
/>
</FilterCategory>
- <FilterCategory icon={<Users />} label="Account Manager">
+ <FilterCategory
+ icon={<Users />}
+ label={translate("crm.common.account_manager", {
+ _: "Account manager",
+ })}
+ >
<ToggleFilterButton
className="w-full justify-between h-10 md:h-8"
- label={"Me"}
+ label={translate("crm.common.me", { _: "Me" })}
value={{ sales_id: identity?.id }}
size={isMobile ? "lg" : undefined}
/>
@@ -136,6 +170,7 @@ export const ContactListFilter = () => {
export const ContactListFilterSummary = () => {
const { noteStatuses } = useConfigurationContext();
const { identity } = useGetIdentity();
+ const translate = useTranslate();
const { data } = useGetList("tags", {
pagination: { page: 1, perPage: 10 },
sort: { field: "name", order: "ASC" },
@@ -153,7 +188,7 @@ export const ContactListFilterSummary = () => {
<div className="flex flex-wrap items-start mb-4 gap-1">
<ActiveFilterButton
className="w-auto justify-between h-8"
- label="Today"
+ label={translate("crm.contacts.filters.today", { _: "Today" })}
value={{
"last_seen@gte": endOfYesterday().toISOString(),
"last_seen@lte": undefined,
@@ -161,7 +196,7 @@ export const ContactListFilterSummary = () => {
/>
<ActiveFilterButton
className="w-auto justify-between h-8"
- label="This week"
+ label={translate("crm.contacts.filters.this_week", { _: "This week" })}
value={{
"last_seen@gte": startOfWeek(new Date()).toISOString(),
"last_seen@lte": undefined,
@@ -169,7 +204,9 @@ export const ContactListFilterSummary = () => {
/>
<ActiveFilterButton
className="w-auto justify-between h-8"
- label="Before this week"
+ label={translate("crm.contacts.filters.before_this_week", {
+ _: "Before this week",
+ })}
value={{
"last_seen@gte": undefined,
"last_seen@lte": startOfWeek(new Date()).toISOString(),
@@ -177,7 +214,9 @@ export const ContactListFilterSummary = () => {
/>
<ActiveFilterButton
className="w-auto justify-between h-8"
- label="Before this month"
+ label={translate("crm.contacts.filters.before_this_month", {
+ _: "Before this month",
+ })}
value={{
"last_seen@gte": undefined,
"last_seen@lte": startOfMonth(new Date()).toISOString(),
@@ -185,7 +224,9 @@ export const ContactListFilterSummary = () => {
/>
<ActiveFilterButton
className="w-auto justify-between h-8"
- label="Before last month"
+ label={translate("crm.contacts.filters.before_last_month", {
+ _: "Before last month",
+ })}
value={{
"last_seen@gte": undefined,
"last_seen@lte": subMonths(startOfMonth(new Date()), 1).toISOString(),
@@ -227,13 +268,17 @@ export const ContactListFilterSummary = () => {
<ActiveFilterButton
className="w-auto justify-between h-8"
- label={"With pending tasks"}
+ label={translate("crm.tasks.filters.with_pending", {
+ _: "With pending tasks",
+ })}
value={{ "nb_tasks@gt": 0 }}
/>
<ActiveFilterButton
className="w-auto justify-between h-8"
- label={"Managed by me"}
+ label={translate("crm.contacts.filters.managed_by_me", {
+ _: "Managed by me",
+ })}
value={{ sales_id: identity?.id }}
/>
</div>
diff --git a/src/components/atomic-crm/dashboard/HotContacts.tsx b/src/components/atomic-crm/dashboard/HotContacts.tsx
index b9039e13..6ef273c1 100644
--- a/src/components/atomic-crm/dashboard/HotContacts.tsx
+++ b/src/components/atomic-crm/dashboard/HotContacts.tsx
@@ -1,5 +1,5 @@
import { Plus, Users } from "lucide-react";
-import { useGetIdentity, useGetList } from "ra-core";
+import { useGetIdentity, useGetList, useTranslate } from "ra-core";
import { Link } from "react-router";
import { Button } from "@/components/ui/button";
import { Card } from "@/components/ui/card";
@@ -16,6 +16,7 @@ import type { Contact } from "../types";
export const HotContacts = () => {
const { identity } = useGetIdentity();
+ const translate = useTranslate();
const {
data: contactData,
total: contactTotal,
@@ -37,7 +38,7 @@ export const HotContacts = () => {
<Users className="text-muted-foreground w-6 h-6" />
</div>
<h2 className="text-xl font-semibold text-muted-foreground">
- Hot Contacts
+ {translate("crm.contacts.hot.title", { _: "Hot Contacts" })}
</h2>
<TooltipProvider>
<Tooltip>
@@ -53,7 +54,9 @@ export const HotContacts = () => {
</Link>
</Button>
</TooltipTrigger>
- <TooltipContent>Create contact</TooltipContent>
+ <TooltipContent>
+ {translate("crm.contacts.hot.create", { _: "Create contact" })}
+ </TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
@@ -70,18 +73,23 @@ export const HotContacts = () => {
}
secondaryText={(contact) => (
<>
- {contact.title} at {contact.company_name}
+ {contact.title} {translate("crm.common.at", { _: "at" })}{" "}
+ {contact.company_name}
</>
)}
leftAvatar={(contact) => <Avatar record={contact} />}
empty={
<div className="p-4">
<p className="text-sm mb-4">
- Contacts with a "hot" status will appear here.
+ {translate("crm.contacts.hot.empty_hint", {
+ _: 'Contacts with a "hot" status will appear here.',
+ })}
</p>
<p className="text-sm">
- Change the status of a contact by adding a note to that contact
- and clicking on "show options".
+ {translate("crm.contacts.hot.empty_change_status", {
+ _:
+ 'Change the status of a contact by adding a note to that contact and clicking on "show options".',
+ })}
</p>
</div>
}
diff --git a/src/components/atomic-crm/deals/DealList.tsx b/src/components/atomic-crm/deals/DealList.tsx
index 71f0a7f8..e3571d56 100644
--- a/src/components/atomic-crm/deals/DealList.tsx
+++ b/src/components/atomic-crm/deals/DealList.tsx
@@ -1,4 +1,4 @@
-import { useGetIdentity, useListContext } from "ra-core";
+import { useGetIdentity, useListContext, useTranslate } from "ra-core";
import { matchPath, useLocation } from "react-router";
import { AutocompleteInput } from "@/components/admin/autocomplete-input";
import { CreateButton } from "@/components/admin/create-button";
@@ -22,17 +22,21 @@ import { OnlyMineInput } from "./OnlyMineInput";
const DealList = () => {
const { identity } = useGetIdentity();
const { dealCategories } = useConfigurationContext();
+ const translate = useTranslate();
if (!identity) return null;
const dealFilters = [
<SearchInput source="q" alwaysOn />,
<ReferenceInput source="company_id" reference="companies">
- <AutocompleteInput label={false} placeholder="Company" />
+ <AutocompleteInput
+ label={false}
+ placeholder={translate("crm.deals.filters.company", { _: "Company" })}
+ />
</ReferenceInput>,
<SelectInput
source="category"
- emptyText="Category"
+ emptyText={translate("crm.deals.inputs.category", { _: "Category" })}
choices={dealCategories}
optionText="label"
optionValue="value"
@@ -90,7 +94,7 @@ const DealActions = () => (
<TopToolbar>
<FilterButton />
<ExportButton />
- <CreateButton label="New Deal" />
+ <CreateButton label="crm.deals.action.new" />
</TopToolbar>
);
diff --git a/src/components/atomic-crm/layout/MobileNavigation.tsx b/src/components/atomic-crm/layout/MobileNavigation.tsx
index ef9c4241..0823a9cf 100644
--- a/src/components/atomic-crm/layout/MobileNavigation.tsx
+++ b/src/components/atomic-crm/layout/MobileNavigation.tsx
@@ -63,7 +63,7 @@ export const MobileNavigation = () => {
return (
<nav
- aria-label="CRM navigation"
+ aria-label={translate("crm.navigation.label", { _: "CRM navigation" })}
className="fixed bottom-0 left-0 right-0 z-50 bg-secondary h-14"
style={{
// iOS bug: even though viewport is set correctly, the bottom safe area inset is not accounted for
diff --git a/src/components/atomic-crm/misc/InfinitePagination.tsx b/src/components/atomic-crm/misc/InfinitePagination.tsx
index 0fff5a37..a67df0ed 100644
--- a/src/components/atomic-crm/misc/InfinitePagination.tsx
+++ b/src/components/atomic-crm/misc/InfinitePagination.tsx
@@ -4,6 +4,7 @@ import {
useInfinitePaginationContext,
useListContext,
useEvent,
+ useTranslate,
} from "ra-core";
import { Item, ItemContent, ItemMedia, ItemTitle } from "@/components/ui/item";
import { Spinner } from "@/components/admin/spinner";
@@ -29,6 +30,7 @@ export const InfinitePagination = ({
offline = null,
options = defaultOptions,
}: InfinitePaginationProps) => {
+ const translate = useTranslate();
const { isPaused, isPending } = useListContext();
const { fetchNextPage, hasNextPage, isFetchingNextPage } =
useInfinitePaginationContext();
@@ -92,7 +94,9 @@ export const InfinitePagination = ({
<Spinner />
</ItemMedia>
<ItemContent>
- <ItemTitle className="line-clamp-1">Loading...</ItemTitle>
+ <ItemTitle className="line-clamp-1">
+ {translate("crm.common.loading", { _: "Loading..." })}
+ </ItemTitle>
</ItemContent>
</Item>
) : (
diff --git a/src/components/atomic-crm/notes/NoteCreate.tsx b/src/components/atomic-crm/notes/NoteCreate.tsx
index c4c8ce76..c7686638 100644
--- a/src/components/atomic-crm/notes/NoteCreate.tsx
+++ b/src/components/atomic-crm/notes/NoteCreate.tsx
@@ -6,6 +6,7 @@ import {
useNotify,
useRecordContext,
useResourceContext,
+ useTranslate,
useUpdate,
type Identifier,
type RaRecord,
@@ -54,6 +55,7 @@ const NoteCreateButton = ({
}) => {
const [update] = useUpdate();
const notify = useNotify();
+ const translate = useTranslate();
const { identity } = useGetIdentity();
const { reset } = useFormContext();
const { refetch } = useListContext();
@@ -87,14 +89,18 @@ const NoteCreateButton = ({
},
previousData: record,
});
- notify("Note added");
+ notify("crm.notes.added", {
+ messageArgs: {
+ _: "Note added",
+ },
+ });
};
return (
<div className="flex justify-end">
<SaveButton
type="button"
- label="Add this note"
+ label={translate("crm.notes.action.add_this", { _: "Add this note" })}
transform={(data) => ({
...data,
[foreignKeyMapping[reference]]: record.id,
@@ -105,7 +111,7 @@ const NoteCreateButton = ({
onSuccess: handleSuccess,
}}
>
- Add this note
+ {translate("crm.notes.action.add_this", { _: "Add this note" })}
</SaveButton>
</div>
);
diff --git a/src/components/atomic-crm/notes/NoteInputs.tsx b/src/components/atomic-crm/notes/NoteInputs.tsx
index bd325692..0a19a3de 100644
--- a/src/components/atomic-crm/notes/NoteInputs.tsx
+++ b/src/components/atomic-crm/notes/NoteInputs.tsx
@@ -1,4 +1,6 @@
import { useState } from "react";
+import { useFormContext } from "react-hook-form";
+import { required, useTranslate } from "ra-core";
import { TextInput } from "@/components/admin/text-input";
import { FileInput } from "@/components/admin/file-input";
import { SelectInput } from "@/components/admin/select-input";
@@ -12,7 +14,6 @@ import { getCurrentDate } from "./utils";
import { AttachmentField } from "./AttachmentField";
import { foreignKeyMapping } from "./foreignKeyMapping";
import { AutocompleteInput, ReferenceInput } from "@/components/admin";
-import { required } from "ra-core";
import { contactOptionText } from "../misc/ContactOption";
import { useIsMobile } from "@/hooks/use-mobile";
@@ -27,6 +28,8 @@ export const NoteInputs = ({
}) => {
const isMobile = useIsMobile();
const { noteStatuses } = useConfigurationContext();
+ const { setValue } = useFormContext();
+ const translate = useTranslate();
const [displayMore, setDisplayMore] = useState(false);
return (
@@ -36,7 +39,9 @@ export const NoteInputs = ({
label={false}
multiline
helperText={false}
- placeholder="Add a note"
+ placeholder={translate("crm.notes.inputs.add_note", {
+ _: "Add a note",
+ })}
rows={6}
/>
@@ -46,7 +51,15 @@ export const NoteInputs = ({
reference={reference}
>
<AutocompleteInput
- label={reference === "contacts" ? "Contact" : "Deal"}
+ label={
+ reference === "contacts"
+ ? translate("crm.notes.inputs.reference_contact", {
+ _: "Contact",
+ })
+ : translate("crm.notes.inputs.reference_deal", {
+ _: "Deal",
+ })
+ }
optionText={
reference === "contacts" ? contactOptionText : undefined
}
@@ -64,13 +77,18 @@ export const NoteInputs = ({
size="sm"
onClick={() => {
setDisplayMore(!displayMore);
+ setValue("date", getCurrentDate());
}}
className="text-sm text-muted-foreground underline hover:no-underline p-0 h-auto cursor-pointer"
>
- Show options
+ {translate("crm.notes.inputs.show_options", {
+ _: "Show options",
+ })}
</Button>
<span className="text-sm text-muted-foreground">
- (attach files, or change details)
+ {translate("crm.notes.inputs.options_hint", {
+ _: "(attach files, or change details)",
+ })}
</span>
</div>
)}
@@ -92,13 +110,13 @@ export const NoteInputs = ({
value: status.value,
}))}
optionText={optionRenderer}
- defaultValue="cold"
+ defaultValue="warm"
helperText={false}
/>
)}
<DateTimeInput
source="date"
- label="Date"
+ label="crm.notes.inputs.date"
helperText={false}
className="text-primary"
defaultValue={getCurrentDate()}
diff --git a/src/components/atomic-crm/root/i18nProvider.tsx b/src/components/atomic-crm/root/i18nProvider.tsx
index 38151f2c..64170d5f 100644
--- a/src/components/atomic-crm/root/i18nProvider.tsx
+++ b/src/components/atomic-crm/root/i18nProvider.tsx
@@ -25,27 +25,55 @@ const raSupabaseFrenchMessagesOverride = {
const englishCrmMessages = {
crm: {
language: "Language",
- profile: {
- title: "Profile",
- },
common: {
account_manager: "Account manager",
+ at: "at",
+ copied: "Copied!",
+ copy: "Copy",
+ loading: "Loading...",
+ me: "Me",
+ },
+ navigation: {
+ label: "CRM navigation",
},
companies: {
name: "Company |||| Companies",
forcedCaseName: "Company",
action: {
create: "Create Company",
+ edit: "Edit company",
+ new: "New Company",
+ show: "Show company",
+ },
+ aside: {
+ additional_info: "Additional info",
+ company_info: "Company info",
+ context: "Context",
+ main_address: "Main address",
},
fields: {
name: "Company name",
+ revenue: "Revenue",
+ sector: "Sector",
+ size: "Size",
+ tax_identifier: "Tax Identifier",
+ },
+ filters: {
+ sector: "Sector",
+ size: "Size",
},
},
contacts: {
name: "Contact |||| Contacts",
forcedCaseName: "Contact",
action: {
+ edit: "Edit contact",
new: "New Contact",
+ show: "Show contact",
+ },
+ background: {
+ added_on: "Added on",
+ followed_by: "Followed by",
},
inputs: {
email_addresses: "Email addresses",
@@ -57,11 +85,34 @@ const englishCrmMessages = {
csv_file: "CSV File",
contacts_label: "contact |||| contacts",
},
+ filters: {
+ before_last_month: "Before last month",
+ before_this_month: "Before this month",
+ before_this_week: "Before this week",
+ last_activity: "Last activity",
+ managed_by_me: "Managed by me",
+ search: "Search name, company...",
+ status: "Status",
+ tags: "Tags",
+ this_week: "This week",
+ today: "Today",
+ },
+ hot: {
+ create: "Create contact",
+ empty_change_status:
+ 'Change the status of a contact by adding a note to that contact and clicking on "show options".',
+ empty_hint: 'Contacts with a "hot" status will appear here.',
+ title: "Hot Contacts",
+ },
},
deals: {
name: "Deal |||| Deals",
action: {
create: "Create deal",
+ new: "New Deal",
+ },
+ filters: {
+ company: "Company",
},
inputs: {
name: "Deal name",
@@ -75,9 +126,28 @@ const englishCrmMessages = {
notes: {
name: "Note |||| Notes",
forcedCaseName: "Note",
+ action: {
+ add_this: "Add this note",
+ },
+ added: "Note added",
+ inputs: {
+ add_note: "Add a note",
+ date: "Date",
+ options_hint: "(attach files, or change details)",
+ reference_contact: "Contact",
+ reference_deal: "Deal",
+ show_options: "Show options",
+ },
},
sales: {
name: "User |||| Users",
+ action: {
+ new: "New user",
+ },
+ fields: {
+ admin: "Admin",
+ disabled: "Disabled",
+ },
},
settings: {
title: "Settings",
@@ -88,10 +158,38 @@ const englishCrmMessages = {
},
tags: {
name: "Tag |||| Tags",
+ dialog: {
+ color: "Color",
+ name_label: "Tag name",
+ name_placeholder: "Enter tag name",
+ },
},
tasks: {
name: "Task |||| Tasks",
forcedCaseName: "Task",
+ fields: {
+ description: "Description",
+ },
+ filters: {
+ with_pending: "With pending tasks",
+ },
+ },
+ profile: {
+ inbound: {
+ description_prefix:
+ "You can start sending emails to your server's inbound email address, e.g. by adding it to the",
+ description_suffix:
+ "field. Atomic CRM will process the emails and add notes to the corresponding contacts.",
+ title: "Inbound email",
+ },
+ password: {
+ change: "Change password",
+ },
+ password_reset_sent:
+ "A reset password email has been sent to your email address",
+ title: "Profile",
+ updated: "Your profile has been updated",
+ update_error: "An error occurred. Please try again",
},
},
};
@@ -99,27 +197,55 @@ const englishCrmMessages = {
const frenchCrmMessages = {
crm: {
language: "Langue",
- profile: {
- title: "Profil",
- },
common: {
account_manager: "Responsable de compte",
+ at: "chez",
+ copied: "Copié !",
+ copy: "Copier",
+ loading: "Chargement...",
+ me: "Moi",
+ },
+ navigation: {
+ label: "Navigation CRM",
},
companies: {
name: "Entreprise |||| Entreprises",
forcedCaseName: "Entreprise",
action: {
create: "Créer une entreprise",
+ edit: "Modifier l'entreprise",
+ new: "Nouvelle entreprise",
+ show: "Afficher l'entreprise",
+ },
+ aside: {
+ additional_info: "Informations supplémentaires",
+ company_info: "Informations de l'entreprise",
+ context: "Contexte",
+ main_address: "Adresse principale",
},
fields: {
name: "Nom de l'entreprise",
+ revenue: "Chiffre d'affaires",
+ sector: "Secteur",
+ size: "Taille",
+ tax_identifier: "Identifiant fiscal",
+ },
+ filters: {
+ sector: "Secteur",
+ size: "Taille",
},
},
contacts: {
name: "Contact |||| Contacts",
forcedCaseName: "Contact",
action: {
+ edit: "Modifier le contact",
new: "Nouveau contact",
+ show: "Afficher le contact",
+ },
+ background: {
+ added_on: "Ajouté le",
+ followed_by: "Suivi par",
},
inputs: {
email_addresses: "Adresses e-mail",
@@ -132,11 +258,34 @@ const frenchCrmMessages = {
csv_file: "Fichier CSV",
contacts_label: "contact |||| contacts",
},
+ filters: {
+ before_last_month: "Avant le mois dernier",
+ before_this_month: "Avant ce mois-ci",
+ before_this_week: "Avant cette semaine",
+ last_activity: "Dernière activité",
+ managed_by_me: "Géré par moi",
+ search: "Rechercher nom, entreprise...",
+ status: "Statut",
+ tags: "Étiquettes",
+ this_week: "Cette semaine",
+ today: "Aujourd'hui",
+ },
+ hot: {
+ create: "Créer un contact",
+ empty_change_status:
+ 'Changez le statut d\'un contact en ajoutant une note à ce contact et en cliquant sur "afficher les options".',
+ empty_hint: 'Les contacts avec un statut "chaud" apparaîtront ici.',
+ title: "Contacts chauds",
+ },
},
deals: {
name: "Affaire |||| Affaires",
action: {
create: "Créer un deal",
+ new: "Nouvelle affaire",
+ },
+ filters: {
+ company: "Entreprise",
},
inputs: {
name: "Nom du deal",
@@ -150,9 +299,28 @@ const frenchCrmMessages = {
notes: {
name: "Note |||| Notes",
forcedCaseName: "Note",
+ action: {
+ add_this: "Ajouter cette note",
+ },
+ added: "Note ajoutée",
+ inputs: {
+ add_note: "Ajouter une note",
+ date: "Date",
+ options_hint: "(joindre des fichiers ou modifier les détails)",
+ reference_contact: "Contact",
+ reference_deal: "Affaire",
+ show_options: "Afficher les options",
+ },
},
sales: {
name: "Utilisateur |||| Utilisateurs",
+ action: {
+ new: "Nouvel utilisateur",
+ },
+ fields: {
+ admin: "Admin",
+ disabled: "Désactivé",
+ },
},
settings: {
title: "Paramètres",
@@ -163,10 +331,38 @@ const frenchCrmMessages = {
},
tags: {
name: "Étiquette |||| Étiquettes",
+ dialog: {
+ color: "Couleur",
+ name_label: "Nom de l'étiquette",
+ name_placeholder: "Saisir le nom de l'étiquette",
+ },
},
tasks: {
name: "Tâche |||| Tâches",
forcedCaseName: "Tâche",
+ fields: {
+ description: "Description",
+ },
+ filters: {
+ with_pending: "Avec des tâches en attente",
+ },
+ },
+ profile: {
+ inbound: {
+ description_prefix:
+ "Vous pouvez commencer à envoyer des e-mails vers l'adresse de réception de votre serveur, par exemple en l'ajoutant au champ",
+ description_suffix:
+ "champ. Atomic CRM traitera les e-mails et ajoutera des notes aux contacts correspondants.",
+ title: "E-mail entrant",
+ },
+ password: {
+ change: "Changer le mot de passe",
+ },
+ password_reset_sent:
+ "Un e-mail de réinitialisation du mot de passe a été envoyé à votre adresse e-mail",
+ title: "Profil",
+ updated: "Votre profil a été mis à jour",
+ update_error: "Une erreur s'est produite. Veuillez réessayer",
},
},
};
diff --git a/src/components/atomic-crm/sales/SalesList.tsx b/src/components/atomic-crm/sales/SalesList.tsx
index 8b905ad9..161dc1d0 100644
--- a/src/components/atomic-crm/sales/SalesList.tsx
+++ b/src/components/atomic-crm/sales/SalesList.tsx
@@ -1,4 +1,4 @@
-import { useRecordContext } from "ra-core";
+import { useRecordContext, useTranslate } from "ra-core";
import { CreateButton } from "@/components/admin/create-button";
import { DataTable } from "@/components/admin/data-table";
import { ExportButton } from "@/components/admin/export-button";
@@ -8,17 +8,21 @@ import { Badge } from "@/components/ui/badge";
import { TopToolbar } from "../layout/TopToolbar";
-const SalesListActions = () => (
- <TopToolbar>
- <ExportButton />
- <CreateButton label="New user" />
- </TopToolbar>
-);
+const SalesListActions = () => {
+ const translate = useTranslate();
+ return (
+ <TopToolbar>
+ <ExportButton />
+ <CreateButton label={translate("crm.sales.action.new", { _: "New user" })} />
+ </TopToolbar>
+ );
+};
const filters = [<SearchInput source="q" alwaysOn />];
const OptionsField = (_props: { label?: string | boolean }) => {
const record = useRecordContext();
+ const translate = useTranslate();
if (!record) return null;
return (
<div className="flex flex-row gap-1">
@@ -27,7 +31,7 @@ const OptionsField = (_props: { label?: string | boolean }) => {
variant="outline"
className="border-blue-300 dark:border-blue-700"
>
- Admin
+ {translate("crm.sales.fields.admin", { _: "Admin" })}
</Badge>
)}
{record.disabled && (
@@ -35,7 +39,7 @@ const OptionsField = (_props: { label?: string | boolean }) => {
variant="outline"
className="border-orange-300 dark:border-orange-700"
>
- Disabled
+ {translate("crm.sales.fields.disabled", { _: "Disabled" })}
</Badge>
)}
</div>
@@ -43,9 +47,10 @@ const OptionsField = (_props: { label?: string | boolean }) => {
};
export function SalesList() {
+ const translate = useTranslate();
return (
<List
- title="Users"
+ title={translate("crm.sales.name", { smart_count: 2, _: "Users" })}
filters={filters}
actions={<SalesListActions />}
sort={{ field: "first_name", order: "ASC" }}
diff --git a/src/components/atomic-crm/settings/ProfilePage.tsx b/src/components/atomic-crm/settings/ProfilePage.tsx
index 38c10b52..5ed8e921 100644
--- a/src/components/atomic-crm/settings/ProfilePage.tsx
+++ b/src/components/atomic-crm/settings/ProfilePage.tsx
@@ -7,6 +7,7 @@ import {
useGetOne,
useNotify,
useRecordContext,
+ useTranslate,
} from "ra-core";
import { useState } from "react";
import { useFormState } from "react-hook-form";
@@ -46,11 +47,18 @@ export const ProfilePage = () => {
refetchIdentity();
refetchUser();
setEditMode(false);
- notify("Your profile has been updated");
+ notify("crm.profile.updated", {
+ messageArgs: {
+ _: "Your profile has been updated",
+ },
+ });
},
onError: (_) => {
- notify("An error occurred. Please try again", {
+ notify("crm.profile.update_error", {
type: "error",
+ messageArgs: {
+ _: "An error occurred. Please try again",
+ },
});
},
});
@@ -78,6 +86,7 @@ const ProfileForm = ({
setEditMode: (value: boolean) => void;
}) => {
const notify = useNotify();
+ const translate = useTranslate();
const record = useRecordContext<Sale>();
const { identity, refetch } = useGetIdentity();
const { isDirty } = useFormState();
@@ -92,7 +101,11 @@ const ProfileForm = ({
return dataProvider.updatePassword(identity.id);
},
onSuccess: () => {
- notify("A reset password email has been sent to your email address");
+ notify("crm.profile.password_reset_sent", {
+ messageArgs: {
+ _: "A reset password email has been sent to your email address",
+ },
+ });
},
onError: (e) => {
notify(`${e}`, {
@@ -111,10 +124,19 @@ const ProfileForm = ({
},
onSuccess: () => {
refetch();
- notify("Your profile has been updated");
+ notify("crm.profile.updated", {
+ messageArgs: {
+ _: "Your profile has been updated",
+ },
+ });
},
onError: () => {
- notify("An error occurred. Please try again.");
+ notify("crm.profile.update_error", {
+ type: "error",
+ messageArgs: {
+ _: "An error occurred. Please try again.",
+ },
+ });
},
});
if (!identity) return null;
@@ -133,7 +155,7 @@ const ProfileForm = ({
<CardContent>
<div className="mb-4 flex flex-row justify-between">
<h2 className="text-xl font-semibold text-muted-foreground">
- Profile
+ {translate("crm.profile.title", { _: "Profile" })}
</h2>
</div>
@@ -157,7 +179,9 @@ const ProfileForm = ({
type="button"
onClick={handleClickOpenPasswordChange}
>
- Change password
+ {translate("crm.profile.password.change", {
+ _: "Change password",
+ })}
</Button>
</>
)}
@@ -169,13 +193,15 @@ const ProfileForm = ({
className="flex items-center"
>
{isEditMode ? <CircleX /> : <Pencil />}
- {isEditMode ? "Cancel" : "Edit"}
+ {isEditMode
+ ? translate("ra.action.cancel", { _: "Cancel" })
+ : translate("ra.action.edit", { _: "Edit" })}
</Button>
{isEditMode && (
<Button type="submit" disabled={!isDirty} variant="outline">
<Save />
- Save
+ {translate("ra.action.save", { _: "Save" })}
</Button>
)}
</div>
@@ -186,13 +212,18 @@ const ProfileForm = ({
<CardContent>
<div className="space-y-4 justify-between">
<h2 className="text-xl font-semibold text-muted-foreground">
- Inbound email
+ {translate("crm.profile.inbound.title", { _: "Inbound email" })}
</h2>
<p className="text-sm text-muted-foreground">
- You can start sending emails to your server's inbound email
- address, e.g. by adding it to the
- <b> Cc: </b> field. Atomic CRM will process the emails and add
- notes to the corresponding contacts.
+ {translate("crm.profile.inbound.description_prefix", {
+ _:
+ "You can start sending emails to your server's inbound email address, e.g. by adding it to the",
+ })}{" "}
+ <b> Cc: </b>{" "}
+ {translate("crm.profile.inbound.description_suffix", {
+ _:
+ "field. Atomic CRM will process the emails and add notes to the corresponding contacts.",
+ })}
</p>
<CopyPaste />
</div>
@@ -221,6 +252,7 @@ const TextRender = ({
};
const CopyPaste = () => {
+ const translate = useTranslate();
const [copied, setCopied] = useState(false);
const handleCopy = () => {
setCopied(true);
@@ -246,7 +278,11 @@ const CopyPaste = () => {
</Button>
</TooltipTrigger>
<TooltipContent>
- <p>{copied ? "Copied!" : "Copy"}</p>
+ <p>
+ {copied
+ ? translate("crm.common.copied", { _: "Copied!" })
+ : translate("crm.common.copy", { _: "Copy" })}
+ </p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
diff --git a/src/components/atomic-crm/tags/TagDialog.tsx b/src/components/atomic-crm/tags/TagDialog.tsx
index f7ace9f2..63a6f588 100644
--- a/src/components/atomic-crm/tags/TagDialog.tsx
+++ b/src/components/atomic-crm/tags/TagDialog.tsx
@@ -1,5 +1,6 @@
import { SaveIcon } from "lucide-react";
import { useEffect, useState, type ChangeEvent, type FormEvent } from "react";
+import { useTranslate } from "ra-core";
import { Button, buttonVariants } from "@/components/ui/button";
import {
Dialog,
@@ -30,6 +31,7 @@ export function TagDialog({
onClose,
onSubmit,
}: TagDialogProps) {
+ const translate = useTranslate();
const [newTagName, setNewTagName] = useState("");
const [newTagColor, setNewTagColor] = useState(colors[0]);
const [disabled, setDisabled] = useState(false);
@@ -70,18 +72,22 @@ export function TagDialog({
<div className="space-y-4 py-4">
<div className="space-y-2">
- <Label htmlFor="tag-name">Tag name</Label>
+ <Label htmlFor="tag-name">
+ {translate("crm.tags.dialog.name_label", { _: "Tag name" })}
+ </Label>
<Input
id="tag-name"
autoFocus
value={newTagName}
onChange={handleNewTagNameChange}
- placeholder="Enter tag name"
+ placeholder={translate("crm.tags.dialog.name_placeholder", {
+ _: "Enter tag name",
+ })}
/>
</div>
<div className="space-y-2">
- <Label>Color</Label>
+ <Label>{translate("crm.tags.dialog.color", { _: "Color" })}</Label>
<div className="flex flex-wrap">
{colors.map((color) => (
<RoundButton
@@ -108,7 +114,7 @@ export function TagDialog({
)}
>
<SaveIcon />
- Save
+ {translate("ra.action.save", { _: "Save" })}
</Button>
</div>
</form>
diff --git a/src/components/atomic-crm/tasks/TaskFormContent.tsx b/src/components/atomic-crm/tasks/TaskFormContent.tsx
index 5fd19a2c..9583e432 100644
--- a/src/components/atomic-crm/tasks/TaskFormContent.tsx
+++ b/src/components/atomic-crm/tasks/TaskFormContent.tsx
@@ -2,7 +2,7 @@ import { AutocompleteInput } from "@/components/admin/autocomplete-input";
import { ReferenceInput } from "@/components/admin/reference-input";
import { SelectInput } from "@/components/admin/select-input";
import { TextInput } from "@/components/admin/text-input";
-import { required } from "ra-core";
+import { required, useTranslate } from "ra-core";
import { contactOptionText } from "../misc/ContactOption";
import { useConfigurationContext } from "../root/ConfigurationContext";
@@ -14,12 +14,13 @@ export const TaskFormContent = ({
selectContact?: boolean;
}) => {
const { taskTypes } = useConfigurationContext();
+ const translate = useTranslate();
return (
<div className="flex flex-col gap-4">
<TextInput
autoFocus
source="text"
- label="Description"
+ label={translate("crm.tasks.fields.description", { _: "Description" })}
validate={required()}
multiline
className="m-0"
@@ -28,7 +29,7 @@ export const TaskFormContent = ({
{selectContact && (
<ReferenceInput source="contact_id" reference="contacts_summary">
<AutocompleteInput
- label="Contact"
+ label={translate("crm.contacts.forcedCaseName", { _: "Contact" })}
optionText={contactOptionText}
helperText={false}
validate={required()}