diff --git a/frontend/src/components/ListViews/ContactsListView.vue b/frontend/src/components/ListViews/ContactsListView.vue index 64fc550b..82cd2a47 100644 --- a/frontend/src/components/ListViews/ContactsListView.vue +++ b/frontend/src/components/ListViews/ContactsListView.vue @@ -172,14 +172,14 @@ function editValues(selections, unselectAll) { function deleteValues(selections, unselectAll) { $dialog({ - title: 'Delete', - message: `Are you sure you want to delete ${selections.size} item${ - selections.size > 1 ? 's' : '' - }?`, + title: __('Delete'), + message: __('Are you sure you want to delete {0} item(s)?', [ + selections.size, + ]), variant: 'danger', actions: [ { - label: 'Delete', + label: __('Delete'), variant: 'solid', theme: 'red', onClick: (close) => { @@ -188,7 +188,7 @@ function deleteValues(selections, unselectAll) { doctype: 'Contact', }).then(() => { createToast({ - title: 'Deleted successfully', + title: __('Deleted successfully'), icon: 'check', iconClasses: 'text-green-600', }) @@ -207,11 +207,11 @@ const customListActions = ref([]) function bulkActions(selections, unselectAll) { let actions = [ { - label: 'Edit', + label: __('Edit'), onClick: () => editValues(selections, unselectAll), }, { - label: 'Delete', + label: __('Delete'), onClick: () => deleteValues(selections, unselectAll), }, ] diff --git a/frontend/src/components/ListViews/DealsListView.vue b/frontend/src/components/ListViews/DealsListView.vue index 57a93e57..7660a29e 100644 --- a/frontend/src/components/ListViews/DealsListView.vue +++ b/frontend/src/components/ListViews/DealsListView.vue @@ -203,14 +203,12 @@ function editValues(selections, unselectAll) { function deleteValues(selections, unselectAll) { $dialog({ - title: 'Delete', - message: `Are you sure you want to delete ${selections.size} item${ - selections.size > 1 ? 's' : '' - }?`, + title: __('Delete'), + message: __('Are you sure you want to delete {0} item(s)?', [selections.size]), variant: 'danger', actions: [ { - label: 'Delete', + label: __('Delete'), variant: 'solid', theme: 'red', onClick: (close) => { @@ -219,7 +217,7 @@ function deleteValues(selections, unselectAll) { doctype: 'CRM Deal', }).then(() => { createToast({ - title: 'Deleted successfully', + title: __('Deleted successfully'), icon: 'check', iconClasses: 'text-green-600', }) @@ -239,17 +237,17 @@ const customListActions = ref([]) function bulkActions(selections, unselectAll) { let actions = [ { - label: 'Edit', + label: __('Edit'), onClick: () => editValues(selections, unselectAll), }, { - label: 'Delete', + label: __('Delete'), onClick: () => deleteValues(selections, unselectAll), }, ] customBulkActions.value.forEach((action) => { actions.push({ - label: action.label, + label: __(action.label), onClick: () => action.onClick({ list: list.value, diff --git a/frontend/src/components/ListViews/EmailTemplatesListView.vue b/frontend/src/components/ListViews/EmailTemplatesListView.vue index b260d0e3..4a5c4f10 100644 --- a/frontend/src/components/ListViews/EmailTemplatesListView.vue +++ b/frontend/src/components/ListViews/EmailTemplatesListView.vue @@ -154,14 +154,14 @@ function editValues(selections, unselectAll) { function deleteValues(selections, unselectAll) { $dialog({ - title: 'Delete', - message: `Are you sure you want to delete ${selections.size} item${ - selections.size > 1 ? 's' : '' - }?`, + title: __('Delete'), + message: __('Are you sure you want to delete {0} item(s)?', [ + selections.size, + ]), variant: 'danger', actions: [ { - label: 'Delete', + label: __('Delete'), variant: 'solid', theme: 'red', onClick: (close) => { @@ -170,7 +170,7 @@ function deleteValues(selections, unselectAll) { doctype: 'Email Template', }).then(() => { createToast({ - title: 'Deleted successfully', + title: __('Deleted successfully'), icon: 'check', iconClasses: 'text-green-600', }) @@ -189,11 +189,11 @@ const customListActions = ref([]) function bulkActions(selections, unselectAll) { let actions = [ { - label: 'Edit', + label: __('Edit'), onClick: () => editValues(selections, unselectAll), }, { - label: 'Delete', + label: __('Delete'), onClick: () => deleteValues(selections, unselectAll), }, ] diff --git a/frontend/src/components/ListViews/OrganizationsListView.vue b/frontend/src/components/ListViews/OrganizationsListView.vue index 059f661b..cfc3c704 100644 --- a/frontend/src/components/ListViews/OrganizationsListView.vue +++ b/frontend/src/components/ListViews/OrganizationsListView.vue @@ -157,14 +157,14 @@ function editValues(selections, unselectAll) { function deleteValues(selections, unselectAll) { $dialog({ - title: 'Delete', - message: `Are you sure you want to delete ${selections.size} item${ - selections.size > 1 ? 's' : '' - }?`, + title: __('Delete'), + message: __('Are you sure you want to delete {0} item(s)?', [ + selections.size, + ]), variant: 'danger', actions: [ { - label: 'Delete', + label: __('Delete'), variant: 'solid', theme: 'red', onClick: (close) => { @@ -173,7 +173,7 @@ function deleteValues(selections, unselectAll) { doctype: 'CRM Organization', }).then(() => { createToast({ - title: 'Deleted successfully', + title: __('Deleted successfully'), icon: 'check', iconClasses: 'text-green-600', }) @@ -192,11 +192,11 @@ const customListActions = ref([]) function bulkActions(selections, unselectAll) { let actions = [ { - label: 'Edit', + label: __('Edit'), onClick: () => editValues(selections, unselectAll), }, { - label: 'Delete', + label: __('Delete'), onClick: () => deleteValues(selections, unselectAll), }, ] diff --git a/frontend/src/components/ListViews/TasksListView.vue b/frontend/src/components/ListViews/TasksListView.vue index 33898cf3..b6e1d80c 100644 --- a/frontend/src/components/ListViews/TasksListView.vue +++ b/frontend/src/components/ListViews/TasksListView.vue @@ -176,14 +176,12 @@ function editValues(selections, unselectAll) { function deleteValues(selections, unselectAll) { $dialog({ - title: 'Delete', - message: `Are you sure you want to delete ${selections.size} item${ - selections.size > 1 ? 's' : '' - }?`, + title: __('Delete'), + message: __('Are you sure you want to delete {0} item(s)?'), variant: 'danger', actions: [ { - label: 'Delete', + label: __('Delete'), variant: 'solid', theme: 'red', onClick: (close) => { @@ -192,7 +190,7 @@ function deleteValues(selections, unselectAll) { doctype: 'CRM Task', }).then(() => { createToast({ - title: 'Deleted successfully', + title: __('Deleted successfully'), icon: 'check', iconClasses: 'text-green-600', }) @@ -211,11 +209,11 @@ const customListActions = ref([]) function bulkActions(selections, unselectAll) { let actions = [ { - label: 'Edit', + label: __('Edit'), onClick: () => editValues(selections, unselectAll), }, { - label: 'Delete', + label: __('Delete'), onClick: () => deleteValues(selections, unselectAll), }, ] diff --git a/frontend/src/pages/CallLogs.vue b/frontend/src/pages/CallLogs.vue index 7d200827..241aad9e 100644 --- a/frontend/src/pages/CallLogs.vue +++ b/frontend/src/pages/CallLogs.vue @@ -44,7 +44,7 @@ class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500" > - No Logs Found + {{ __('No Logs Found') }} @@ -69,7 +69,7 @@ import { computed, ref } from 'vue' const { getUser } = usersStore() const { getContact, getLeadContact } = contactsStore() -const breadcrumbs = [{ label: 'Call Logs', route: { name: 'Call Logs' } }] +const breadcrumbs = [{ label: __('Call Logs'), route: { name: 'Call Logs' } }] const callLogsListView = ref(null) diff --git a/frontend/src/pages/Contacts.vue b/frontend/src/pages/Contacts.vue index 17b5591f..8130f527 100644 --- a/frontend/src/pages/Contacts.vue +++ b/frontend/src/pages/Contacts.vue @@ -8,7 +8,11 @@ v-if="contactsListView?.customListActions" :actions="contactsListView.customListActions" /> - @@ -47,8 +51,8 @@ class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500" > - No Contacts Found - @@ -81,10 +85,10 @@ const currentContact = computed(() => { }) const breadcrumbs = computed(() => { - let items = [{ label: 'Contacts', route: { name: 'Contacts' } }] + let items = [{ label: __('Contacts'), route: { name: 'Contacts' } }] if (!currentContact.value) return items items.push({ - label: currentContact.value.full_name, + label: __(currentContact.value.full_name), route: { name: 'Contact', params: { contactId: currentContact.value.name }, diff --git a/frontend/src/pages/Deals.vue b/frontend/src/pages/Deals.vue index f00fcbd5..03d513a7 100644 --- a/frontend/src/pages/Deals.vue +++ b/frontend/src/pages/Deals.vue @@ -8,7 +8,11 @@ v-if="dealsListView?.customListActions" :actions="dealsListView.customListActions" /> - @@ -44,8 +48,8 @@ class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500" > - No Deals Found - @@ -54,8 +58,7 @@ v-model="showNewDialog" :options="{ size: '3xl', - title: 'New Deal', - actions: [{ label: 'Save', variant: 'solid' }], + title: __('New Deal'), }" > @@ -85,12 +92,13 @@ import { timeAgo, formatNumberIntoCurrency, formatTime, + createToast, } from '@/utils' import { createResource, Breadcrumbs } from 'frappe-ui' import { useRouter } from 'vue-router' import { ref, computed, reactive } from 'vue' -const breadcrumbs = [{ label: 'Deals', route: { name: 'Deals' } }] +const breadcrumbs = [{ label: __('Deals'), route: { name: 'Deals' } }] const { getUser } = usersStore() const { getOrganization } = organizationsStore() @@ -218,7 +226,13 @@ function createNewDeal(close) { .submit(newDeal, { validate() { if (!newDeal.first_name) { - return 'First name is required' + createToast({ + title: __('Error creating deal'), + text: __('First name is required'), + icon: 'x', + iconClasses: 'text-red-600', + }) + return __('First name is required') } }, onSuccess(data) { diff --git a/frontend/src/pages/EmailTemplates.vue b/frontend/src/pages/EmailTemplates.vue index e8e06742..b9a48918 100644 --- a/frontend/src/pages/EmailTemplates.vue +++ b/frontend/src/pages/EmailTemplates.vue @@ -8,7 +8,11 @@ v-if="emailTemplatesListView?.customListActions" :actions="emailTemplatesListView.customListActions" /> - @@ -48,7 +52,10 @@ class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500" > - No Email Templates Found + {{ __('No Email Templates Found') }} + { const showEmailTemplateModal = ref(false) const emailTemplate = ref({ - subject: '', - response: '', - name: '', - enabled: 1, - owner: '', - reference_doctype: 'CRM Deal', + subject: '', + response: '', + name: '', + enabled: 1, + owner: '', + reference_doctype: 'CRM Deal', }) function showEmailTemplate(name) { diff --git a/frontend/src/pages/Notes.vue b/frontend/src/pages/Notes.vue index 065d9bfe..32d90c25 100644 --- a/frontend/src/pages/Notes.vue +++ b/frontend/src/pages/Notes.vue @@ -4,7 +4,7 @@ @@ -16,7 +16,7 @@ doctype="FCRM Note" :options="{ hideColumnsButton: true, - defaultViewName: 'Notes View', + defaultViewName: __('Notes View'), }" />
@@ -36,8 +36,8 @@ - No Notes Found -
@@ -121,13 +121,7 @@ import { ref, watch } from 'vue' const { getUser } = usersStore() -const list = { - title: 'Notes', - plural_label: 'Notes', - singular_label: 'Note', -} - -const breadcrumbs = [{ label: list.title, route: { name: 'Notes' } }] +const breadcrumbs = [{ label: __('Notes'), route: { name: 'Notes' } }] const showNoteModal = ref(false) const currentNote = ref(null) diff --git a/frontend/src/pages/Organizations.vue b/frontend/src/pages/Organizations.vue index d0d20dd7..165069c9 100644 --- a/frontend/src/pages/Organizations.vue +++ b/frontend/src/pages/Organizations.vue @@ -10,7 +10,7 @@ /> @@ -88,10 +88,10 @@ const currentOrganization = computed(() => { }) const breadcrumbs = computed(() => { - let items = [{ label: 'Organizations', route: { name: 'Organizations' } }] + let items = [{ label: __('Organizations'), route: { name: 'Organizations' } }] if (!currentOrganization.value) return items items.push({ - label: currentOrganization.value.name, + label: __(currentOrganization.value.name), route: { name: 'Organization', params: { organizationId: currentOrganization.value.name }, diff --git a/frontend/src/pages/Tasks.vue b/frontend/src/pages/Tasks.vue index f4f77188..604bbe8a 100644 --- a/frontend/src/pages/Tasks.vue +++ b/frontend/src/pages/Tasks.vue @@ -8,7 +8,7 @@ v-if="tasksListView?.customListActions" :actions="tasksListView.customListActions" /> - @@ -45,7 +45,10 @@ class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500" > - No Tasks Found + {{ __('No Tasks Found') }} + @@ -63,7 +66,7 @@ import { dateFormat, dateTooltipFormat, timeAgo } from '@/utils' import { Breadcrumbs } from 'frappe-ui' import { computed, ref } from 'vue' -const breadcrumbs = [{ label: 'Tasks', route: { name: 'Tasks' } }] +const breadcrumbs = [{ label: __('Tasks'), route: { name: 'Tasks' } }] const { getUser } = usersStore()