fix: added translation in CommunicationArea, Email & Comment Box component

This commit is contained in:
Shariq Ansari 2024-04-15 19:22:16 +05:30
parent d0ec9bb5b4
commit 7e203a0a29
3 changed files with 26 additions and 18 deletions

View File

@ -64,11 +64,11 @@
</FileUploader> </FileUploader>
</div> </div>
<div class="mt-2 flex items-center justify-end space-x-2 sm:mt-0"> <div class="mt-2 flex items-center justify-end space-x-2 sm:mt-0">
<Button v-bind="discardButtonProps || {}" label="Discard" /> <Button v-bind="discardButtonProps || {}" :label="__('Discard')" />
<Button <Button
variant="solid" variant="solid"
v-bind="submitButtonProps || {}" v-bind="submitButtonProps || {}"
label="Submit" :label="__('Comment')"
/> />
</div> </div>
</div> </div>

View File

@ -5,7 +5,7 @@
ref="sendEmailRef" ref="sendEmailRef"
variant="ghost" variant="ghost"
:class="[showEmailBox ? '!bg-gray-300 hover:!bg-gray-200' : '']" :class="[showEmailBox ? '!bg-gray-300 hover:!bg-gray-200' : '']"
label="Reply" :label="__('Reply')"
@click="toggleEmailBox()" @click="toggleEmailBox()"
> >
<template #prefix> <template #prefix>
@ -14,7 +14,7 @@
</Button> </Button>
<Button <Button
variant="ghost" variant="ghost"
label="Comment" :label="__('Comment')"
:class="[showCommentBox ? '!bg-gray-300 hover:!bg-gray-200' : '']" :class="[showCommentBox ? '!bg-gray-300 hover:!bg-gray-200' : '']"
@click="toggleCommentBox()" @click="toggleCommentBox()"
> >
@ -25,12 +25,12 @@
</div> </div>
<div v-if="showEmailBox" class="flex gap-1.5"> <div v-if="showEmailBox" class="flex gap-1.5">
<Button <Button
label="CC" :label="__('CC')"
@click="toggleCC()" @click="toggleCC()"
:class="[newEmailEditor.cc ? 'bg-gray-300 hover:bg-gray-200' : '']" :class="[newEmailEditor.cc ? 'bg-gray-300 hover:bg-gray-200' : '']"
/> />
<Button <Button
label="BCC" :label="__('BCC')"
@click="toggleBCC()" @click="toggleBCC()"
:class="[newEmailEditor.bcc ? 'bg-gray-300 hover:bg-gray-200' : '']" :class="[newEmailEditor.bcc ? 'bg-gray-300 hover:bg-gray-200' : '']"
/> />
@ -66,7 +66,9 @@
v-model:attachments="attachments" v-model:attachments="attachments"
:doctype="doctype" :doctype="doctype"
:subject="subject" :subject="subject"
placeholder="Add a reply..." :placeholder="
__('Hi John, \n\nCan you please provide more details on this...')
"
/> />
</div> </div>
<div v-show="showCommentBox"> <div v-show="showCommentBox">
@ -88,7 +90,7 @@
v-model="doc.data" v-model="doc.data"
v-model:attachments="attachments" v-model:attachments="attachments"
:doctype="doctype" :doctype="doctype"
placeholder="Add a comment..." :placeholder="__('@John, can you please check this?')"
/> />
</div> </div>
</template> </template>

View File

@ -10,7 +10,7 @@
> >
<template #top> <template #top>
<div class="mx-10 flex items-center gap-2 border-t py-2.5"> <div class="mx-10 flex items-center gap-2 border-t py-2.5">
<span class="text-xs text-gray-500">SUBJECT:</span> <span class="text-xs text-gray-500">{{ __('SUBJECT') }}:</span>
<TextInput <TextInput
class="flex-1 border-none bg-white hover:bg-white focus:border-none focus:!shadow-none focus-visible:!ring-0" class="flex-1 border-none bg-white hover:bg-white focus:border-none focus:!shadow-none focus-visible:!ring-0"
v-model="subject" v-model="subject"
@ -20,12 +20,14 @@
class="mx-10 flex items-center gap-2 border-t py-2.5" class="mx-10 flex items-center gap-2 border-t py-2.5"
:class="[cc || bcc ? 'border-b' : '']" :class="[cc || bcc ? 'border-b' : '']"
> >
<span class="text-xs text-gray-500">TO:</span> <span class="text-xs text-gray-500">{{ __('TO') }}:</span>
<MultiselectInput <MultiselectInput
class="flex-1" class="flex-1"
v-model="toEmails" v-model="toEmails"
:validate="validateEmail" :validate="validateEmail"
:error-message="(value) => `${value} is an invalid email address`" :error-message="
(value) => __('{0} is an invalid email address', [value])
"
/> />
</div> </div>
<div <div
@ -33,23 +35,27 @@
class="mx-10 flex items-center gap-2 py-2.5" class="mx-10 flex items-center gap-2 py-2.5"
:class="bcc ? 'border-b' : ''" :class="bcc ? 'border-b' : ''"
> >
<span class="text-xs text-gray-500">CC:</span> <span class="text-xs text-gray-500">{{ __('CC') }}:</span>
<MultiselectInput <MultiselectInput
ref="ccInput" ref="ccInput"
class="flex-1" class="flex-1"
v-model="ccEmails" v-model="ccEmails"
:validate="validateEmail" :validate="validateEmail"
:error-message="(value) => `${value} is an invalid email address`" :error-message="
(value) => __('{0} is an invalid email address', [value])
"
/> />
</div> </div>
<div v-if="bcc" class="mx-10 flex items-center gap-2 py-2.5"> <div v-if="bcc" class="mx-10 flex items-center gap-2 py-2.5">
<span class="text-xs text-gray-500">BCC:</span> <span class="text-xs text-gray-500">{{ __('BCC') }}:</span>
<MultiselectInput <MultiselectInput
ref="bccInput" ref="bccInput"
class="flex-1" class="flex-1"
v-model="bccEmails" v-model="bccEmails"
:validate="validateEmail" :validate="validateEmail"
:error-message="(value) => `${value} is an invalid email address`" :error-message="
(value) => __('{0} is an invalid email address', [value])
"
/> />
</div> </div>
</template> </template>
@ -114,11 +120,11 @@
</div> </div>
</div> </div>
<div class="mt-2 flex items-center justify-end space-x-2 sm:mt-0"> <div class="mt-2 flex items-center justify-end space-x-2 sm:mt-0">
<Button v-bind="discardButtonProps || {}" label="Discard" /> <Button v-bind="discardButtonProps || {}" :label="__('Discard')" />
<Button <Button
variant="solid" variant="solid"
v-bind="submitButtonProps || {}" v-bind="submitButtonProps || {}"
label="Submit" :label="__('Send')"
/> />
</div> </div>
</div> </div>
@ -158,7 +164,7 @@ const props = defineProps({
}, },
subject: { subject: {
type: String, type: String,
default: 'Email from Lead', default: __('Email from Lead'),
}, },
editorProps: { editorProps: {
type: Object, type: Object,