Skip to content

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

refactor(i18n): use crm keys for Atomic CRM labels

Anibal Svarcas7f268eabac1b
diff --git a/src/components/atomic-crm/companies/CompanyInputs.tsx b/src/components/atomic-crm/companies/CompanyInputs.tsx
index 1d55a17c..b58e9eee 100644
--- a/src/components/atomic-crm/companies/CompanyInputs.tsx
+++ b/src/components/atomic-crm/companies/CompanyInputs.tsx
@@ -63,7 +63,7 @@ const CompanyDisplayInputs = () => {
className="w-full h-fit"
validate={required()}
helperText={false}
- placeholder={translate("resources.companies.fields.name", {
+ placeholder={translate("crm.companies.fields.name", {
_: "Company name",
})}
/>
diff --git a/src/components/atomic-crm/companies/CompanyShow.tsx b/src/components/atomic-crm/companies/CompanyShow.tsx
index c5cdd453..8077127d 100644
--- a/src/components/atomic-crm/companies/CompanyShow.tsx
+++ b/src/components/atomic-crm/companies/CompanyShow.tsx
@@ -63,7 +63,7 @@ const CompanyShowContentMobile = () => {
<div className="flex flex-1">
<Link to="/">
<h1 className="text-xl font-semibold">
- {translate("resources.companies.forcedCaseName", {
+ {translate("crm.companies.forcedCaseName", {
_: "Company",
})}
</h1>
diff --git a/src/components/atomic-crm/contacts/ContactImportButton.tsx b/src/components/atomic-crm/contacts/ContactImportButton.tsx
index 99252d12..05fda340 100644
--- a/src/components/atomic-crm/contacts/ContactImportButton.tsx
+++ b/src/components/atomic-crm/contacts/ContactImportButton.tsx
@@ -122,7 +122,7 @@ export function ContactImportDialog({
<strong>
{importer.importCount} / {importer.rowCount}
</strong>{" "}
- {translate("resources.contacts.name", {
+ {translate("crm.contacts.import.contacts_label", {
smart_count: 2,
_: "contacts",
})}
diff --git a/src/components/atomic-crm/contacts/ContactShow.tsx b/src/components/atomic-crm/contacts/ContactShow.tsx
index 7bcf8301..94359db3 100644
--- a/src/components/atomic-crm/contacts/ContactShow.tsx
+++ b/src/components/atomic-crm/contacts/ContactShow.tsx
@@ -135,7 +135,7 @@ const ContactShowContentMobile = () => {
<Tabs defaultValue="notes" className="w-full">
<TabsList className="grid w-full grid-cols-3 h-10">
<TabsTrigger value="notes">
- {translate("resources.contact_notes.name", {
+ {translate("crm.notes.name", {
smart_count: 2,
_: "Notes",
})}
@@ -146,7 +146,7 @@ const ContactShowContentMobile = () => {
reference="tasks"
filter={{ "done_date@is": null }}
/>{" "}
- {translate("resources.tasks.name", {
+ {translate("crm.tasks.name", {
smart_count: 2,
_: "Tasks",
})}
@@ -220,7 +220,7 @@ const ContactShowContentMobile = () => {
</div>
<div>
<h3 className="text-lg font-semibold">
- {translate("resources.tags.name", {
+ {translate("crm.tags.name", {
smart_count: 2,
_: "Tags",
})}
diff --git a/src/components/atomic-crm/deals/DealShow.tsx b/src/components/atomic-crm/deals/DealShow.tsx
index 26c4c16a..5956686d 100644
--- a/src/components/atomic-crm/deals/DealShow.tsx
+++ b/src/components/atomic-crm/deals/DealShow.tsx
@@ -150,7 +150,7 @@ const DealShowContent = () => {
<div className="m-4">
<div className="flex flex-col min-h-12 mr-10">
<span className="text-xs text-muted-foreground tracking-wide">
- {translate("resources.contacts.name", {
+ {translate("crm.contacts.name", {
smart_count: 2,
_: "Contacts",
})}
diff --git a/src/components/atomic-crm/layout/Header.tsx b/src/components/atomic-crm/layout/Header.tsx
index c6f1e932..3b224e0f 100644
--- a/src/components/atomic-crm/layout/Header.tsx
+++ b/src/components/atomic-crm/layout/Header.tsx
@@ -66,7 +66,7 @@ const Header = () => {
isActive={currentPath === "/"}
/>
<NavigationTab
- label={translate("resources.contacts.name", {
+ label={translate("crm.contacts.name", {
smart_count: 2,
_: "Contacts",
})}
@@ -74,7 +74,7 @@ const Header = () => {
isActive={currentPath === "/contacts"}
/>
<NavigationTab
- label={translate("resources.companies.name", {
+ label={translate("crm.companies.name", {
smart_count: 2,
_: "Companies",
})}
@@ -82,7 +82,7 @@ const Header = () => {
isActive={currentPath === "/companies"}
/>
<NavigationTab
- label={translate("resources.deals.name", {
+ label={translate("crm.deals.name", {
smart_count: 2,
_: "Deals",
})}
@@ -145,7 +145,7 @@ const UsersMenu = () => {
<DropdownMenuItem asChild onClick={userMenuContext.onClose}>
<Link to="/sales" className="flex items-center gap-2">
<Users />
- {translate("resources.sales.name", { smart_count: 2, _: "Users" })}
+ {translate("crm.sales.name", { smart_count: 2, _: "Users" })}
</Link>
</DropdownMenuItem>
);
diff --git a/src/components/atomic-crm/layout/MobileNavigation.tsx b/src/components/atomic-crm/layout/MobileNavigation.tsx
index f331db5d..ef9c4241 100644
--- a/src/components/atomic-crm/layout/MobileNavigation.tsx
+++ b/src/components/atomic-crm/layout/MobileNavigation.tsx
@@ -86,7 +86,7 @@ export const MobileNavigation = () => {
<NavigationButton
href="/contacts"
Icon={Users}
- label={translate("resources.contacts.name", {
+ label={translate("crm.contacts.name", {
smart_count: 2,
_: "Contacts",
})}
@@ -96,7 +96,7 @@ export const MobileNavigation = () => {
<NavigationButton
href="/tasks"
Icon={ListTodo}
- label={translate("resources.tasks.name", {
+ label={translate("crm.tasks.name", {
smart_count: 2,
_: "Tasks",
})}
@@ -176,7 +176,7 @@ const CreateButton = () => {
setContactCreateOpen(true);
}}
>
- {translate("resources.contacts.forcedCaseName", { _: "Contact" })}
+ {translate("crm.contacts.forcedCaseName", { _: "Contact" })}
</DropdownMenuItem>
<DropdownMenuItem
className="h-12 px-4 text-base"
@@ -184,7 +184,7 @@ const CreateButton = () => {
setNoteCreateOpen(true);
}}
>
- {translate("resources.contact_notes.forcedCaseName", { _: "Note" })}
+ {translate("crm.notes.forcedCaseName", { _: "Note" })}
</DropdownMenuItem>
<DropdownMenuItem
className="h-12 px-4 text-base"
@@ -192,7 +192,7 @@ const CreateButton = () => {
setTaskCreateOpen(true);
}}
>
- {translate("resources.tasks.forcedCaseName", { _: "Task" })}
+ {translate("crm.tasks.forcedCaseName", { _: "Task" })}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
diff --git a/src/components/atomic-crm/root/i18nProvider.tsx b/src/components/atomic-crm/root/i18nProvider.tsx
index 507898fc..38151f2c 100644
--- a/src/components/atomic-crm/root/i18nProvider.tsx
+++ b/src/components/atomic-crm/root/i18nProvider.tsx
@@ -25,15 +25,25 @@ const raSupabaseFrenchMessagesOverride = {
const englishCrmMessages = {
crm: {
language: "Language",
+ profile: {
+ title: "Profile",
+ },
common: {
account_manager: "Account manager",
},
companies: {
+ name: "Company |||| Companies",
+ forcedCaseName: "Company",
action: {
create: "Create Company",
},
+ fields: {
+ name: "Company name",
+ },
},
contacts: {
+ name: "Contact |||| Contacts",
+ forcedCaseName: "Contact",
action: {
new: "New Contact",
},
@@ -45,9 +55,11 @@ const englishCrmMessages = {
},
import: {
csv_file: "CSV File",
+ contacts_label: "contact |||| contacts",
},
},
deals: {
+ name: "Deal |||| Deals",
action: {
create: "Create deal",
},
@@ -60,27 +72,52 @@ const englishCrmMessages = {
description: "Description",
},
},
+ notes: {
+ name: "Note |||| Notes",
+ forcedCaseName: "Note",
+ },
+ sales: {
+ name: "User |||| Users",
+ },
settings: {
+ title: "Settings",
app_title: "App Title",
sections: {
branding: "Branding",
},
},
+ tags: {
+ name: "Tag |||| Tags",
+ },
+ tasks: {
+ name: "Task |||| Tasks",
+ forcedCaseName: "Task",
+ },
},
};
const frenchCrmMessages = {
crm: {
language: "Langue",
+ profile: {
+ title: "Profil",
+ },
common: {
account_manager: "Responsable de compte",
},
companies: {
+ name: "Entreprise |||| Entreprises",
+ forcedCaseName: "Entreprise",
action: {
create: "Créer une entreprise",
},
+ fields: {
+ name: "Nom de l'entreprise",
+ },
},
contacts: {
+ name: "Contact |||| Contacts",
+ forcedCaseName: "Contact",
action: {
new: "Nouveau contact",
},
@@ -93,9 +130,11 @@ const frenchCrmMessages = {
},
import: {
csv_file: "Fichier CSV",
+ contacts_label: "contact |||| contacts",
},
},
deals: {
+ name: "Affaire |||| Affaires",
action: {
create: "Créer un deal",
},
@@ -108,12 +147,27 @@ const frenchCrmMessages = {
description: "Description",
},
},
+ notes: {
+ name: "Note |||| Notes",
+ forcedCaseName: "Note",
+ },
+ sales: {
+ name: "Utilisateur |||| Utilisateurs",
+ },
settings: {
+ title: "Paramètres",
app_title: "Titre de l'application",
sections: {
branding: "Image de marque",
},
},
+ tags: {
+ name: "Étiquette |||| Étiquettes",
+ },
+ tasks: {
+ name: "Tâche |||| Tâches",
+ forcedCaseName: "Tâche",
+ },
},
};
diff --git a/src/components/atomic-crm/settings/SettingsPage.tsx b/src/components/atomic-crm/settings/SettingsPage.tsx
index dda8faf6..5028f1f9 100644
--- a/src/components/atomic-crm/settings/SettingsPage.tsx
+++ b/src/components/atomic-crm/settings/SettingsPage.tsx
@@ -34,12 +34,12 @@ const SECTIONS = [
},
{
id: "companies",
- label: "resources.companies.name",
+ label: "crm.companies.name",
fallback: "Companies",
},
- { id: "deals", label: "resources.deals.name", fallback: "Deals" },
- { id: "notes", label: "resources.contact_notes.name", fallback: "Notes" },
- { id: "tasks", label: "resources.tasks.name", fallback: "Tasks" },
+ { id: "deals", label: "crm.deals.name", fallback: "Deals" },
+ { id: "notes", label: "crm.notes.name", fallback: "Notes" },
+ { id: "tasks", label: "crm.tasks.name", fallback: "Tasks" },
];
/** Ensure every item in a { value, label } array has a value (slug from label). */
@@ -224,7 +224,7 @@ const SettingsFormFields = () => {
<Card id="companies">
<CardContent className="space-y-4">
<h2 className="text-xl font-semibold text-muted-foreground">
- {translate("resources.companies.name", {
+ {translate("crm.companies.name", {
smart_count: 2,
_: "Companies",
})}
@@ -248,7 +248,7 @@ const SettingsFormFields = () => {
<Card id="deals">
<CardContent className="space-y-4">
<h2 className="text-xl font-semibold text-muted-foreground">
- {translate("resources.deals.name", {
+ {translate("crm.deals.name", {
smart_count: 2,
_: "Deals",
})}
@@ -334,7 +334,7 @@ const SettingsFormFields = () => {
<Card id="notes">
<CardContent className="space-y-4">
<h2 className="text-xl font-semibold text-muted-foreground">
- {translate("resources.contact_notes.name", {
+ {translate("crm.notes.name", {
smart_count: 2,
_: "Notes",
})}
@@ -355,7 +355,7 @@ const SettingsFormFields = () => {
<Card id="tasks">
<CardContent className="space-y-4">
<h2 className="text-xl font-semibold text-muted-foreground">
- {translate("resources.tasks.name", {
+ {translate("crm.tasks.name", {
smart_count: 2,
_: "Tasks",
})}
diff --git a/src/components/atomic-crm/tasks/MobileTasksList.tsx b/src/components/atomic-crm/tasks/MobileTasksList.tsx
index e2661f03..9f8f9128 100644
--- a/src/components/atomic-crm/tasks/MobileTasksList.tsx
+++ b/src/components/atomic-crm/tasks/MobileTasksList.tsx
@@ -9,7 +9,7 @@ export const MobileTasksList = () => {
<>
<MobileHeader>
<h1 className="text-xl font-semibold">
- {translate("resources.tasks.name", { smart_count: 2, _: "Tasks" })}
+ {translate("crm.tasks.name", { smart_count: 2, _: "Tasks" })}
</h1>
</MobileHeader>
<MobileContent>