From 29855132cf9b768fd8c33a23f2cd347b45d6341b Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 15 Apr 2024 19:36:02 +0530 Subject: [PATCH] fix: added translation in Lead Page --- frontend/src/pages/Lead.vue | 85 ++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 38 deletions(-) diff --git a/frontend/src/pages/Lead.vue b/frontend/src/pages/Lead.vue index 6f62888a..ff1ff642 100644 --- a/frontend/src/pages/Lead.vue +++ b/frontend/src/pages/Lead.vue @@ -33,7 +33,7 @@ - + - + - + @@ -190,11 +190,11 @@ - +
-
Choose Existing
+
{{ __('Choose Existing') }}
- New organization will be created based on the data in details section + {{ + __( + 'New organization will be created based on the data in details section' + ) + }}
- +
-
Choose Existing
+
{{ __('Choose Existing') }}
- New contact will be created based on the person's details + {{ __("New contact will be created based on the person's details") }}
@@ -352,7 +356,7 @@ function updateLead(fieldname, value, callback) { lead.reload() reload.value = true createToast({ - title: 'Lead updated', + title: __('Lead updated'), icon: 'check', iconClasses: 'text-green-600', }) @@ -360,8 +364,8 @@ function updateLead(fieldname, value, callback) { }, onError: (err) => { createToast({ - title: 'Error updating lead', - text: err.messages?.[0], + title: __('Error updating lead'), + text: __(err.messages?.[0]), icon: 'x', iconClasses: 'text-red-600', }) @@ -373,8 +377,8 @@ function validateRequired(fieldname, value) { let meta = lead.data.all_fields || {} if (meta[fieldname]?.reqd && !value) { createToast({ - title: 'Error Updating Lead', - text: `${meta[fieldname].label} is a required field`, + title: __('Error Updating Lead'), + text: __('{0} is a required field', [meta[fieldname].label]), icon: 'x', iconClasses: 'text-red-600', }) @@ -384,9 +388,9 @@ function validateRequired(fieldname, value) { } const breadcrumbs = computed(() => { - let items = [{ label: 'Leads', route: { name: 'Leads' } }] + let items = [{ label: __('Leads'), route: { name: 'Leads' } }] items.push({ - label: lead.data.lead_name, + label: __(lead.data.lead_name), route: { name: 'Lead', params: { leadId: lead.data.name } }, }) return items @@ -395,23 +399,28 @@ const breadcrumbs = computed(() => { const tabIndex = ref(0) const tabs = [ { - label: 'Activity', + name: 'Activity', + label: __('Activity'), icon: ActivityIcon, }, { - label: 'Emails', + name: 'Emails', + label: __('Emails'), icon: EmailIcon, }, { - label: 'Calls', + name: 'Calls', + label: __('Calls'), icon: PhoneIcon, }, { - label: 'Tasks', + name: 'Tasks', + label: __('Tasks'), icon: TaskIcon, }, { - label: 'Notes', + name: 'Notes', + label: __('Notes'), icon: NoteIcon, }, ] @@ -419,7 +428,7 @@ const tabs = [ function validateFile(file) { let extn = file.name.split('.').pop().toLowerCase() if (!['png', 'jpg', 'jpeg'].includes(extn)) { - return 'Only PNG and JPG images are allowed' + return __('Only PNG and JPG images are allowed') } } @@ -457,8 +466,8 @@ async function convertToDeal(updated) { if (existingContactChecked.value && !existingContact.value) { createToast({ - title: 'Error', - text: 'Please select an existing contact', + title: __('Error'), + text: __('Please select an existing contact'), icon: 'x', iconClasses: 'text-red-600', }) @@ -467,8 +476,8 @@ async function convertToDeal(updated) { if (existingOrganizationChecked.value && !existingOrganization.value) { createToast({ - title: 'Error', - text: 'Please select an existing organization', + title: __('Error'), + text: __('Please select an existing organization'), icon: 'x', iconClasses: 'text-red-600', })