finish translate

This commit is contained in:
Gabriel Pastori 2023-12-16 19:40:07 -03:00
parent dca4ea21c2
commit 6a43b65a70
12 changed files with 249 additions and 100 deletions

View File

@ -7,7 +7,7 @@
v-ripple v-ripple
> >
<v-icon start>mdi-account-question</v-icon> <v-icon start>mdi-account-question</v-icon>
Tem Whatsapp? {{ $t("phoneHasWhatsApp.title") }}
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn <v-btn
size="small" size="small"
@ -27,18 +27,20 @@
<v-text-field <v-text-field
v-model="phone" v-model="phone"
label="Número" :label="$t('phoneHasWhatsApp.phone')"
outlined outlined
clearable clearable
variant="outlined" variant="outlined"
density="compact" density="compact"
class=" mt-3" class="mt-3"
hint="DDI + DDD + Número" hint="DDI + DDD + Número"
/> />
<v-alert v-if="response" :type="response.exists ? 'success' : 'error'"> <v-alert v-if="response" :type="response.exists ? 'success' : 'error'">
{{ {{
response.exists ? "Whatsapp encontrado" : "Whatsapp não encontrado" response.exists
? $t("phoneHasWhatsApp.exists")
: $t("phoneHasWhatsApp.notExists")
}} }}
<v-chip v-if="response.exists" text-color="white" class="ml-2"> <v-chip v-if="response.exists" text-color="white" class="ml-2">
@ -55,7 +57,7 @@
@click="verifyPhone" @click="verifyPhone"
variant="tonal" variant="tonal"
> >
Consultar {{ $t("phoneHasWhatsApp.verify") }}
</v-btn> </v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
@ -95,7 +97,7 @@ export default {
this.response = false; this.response = false;
const phone = this.formatPhone(this.phone); const phone = this.formatPhone(this.phone);
if (phone.length < 10) throw new Error("Número inválido"); if (phone.length < 10) throw new Error(this.$t("phoneHasWhatsApp.invalid"));
const response = await instanceController.chat.hasWhatsapp( const response = await instanceController.chat.hasWhatsapp(
this.instance.instance.instanceName, this.instance.instance.instanceName,

View File

@ -7,7 +7,7 @@
v-ripple v-ripple
> >
<v-icon start>mdi-message</v-icon> <v-icon start>mdi-message</v-icon>
Minhas conversas {{ $t("chats.title") }}
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn <v-btn
size="small" size="small"
@ -27,7 +27,7 @@
<v-text-field <v-text-field
v-model="search" v-model="search"
label="Pesquisar" :label="$t('search')"
outlined outlined
clearable clearable
variant="outlined" variant="outlined"
@ -38,9 +38,9 @@
<v-data-table <v-data-table
:headers="[ :headers="[
{ title: 'Número', value: 'id' }, { title: 'Whatsapp', value: 'id' },
{ {
title: 'Ultima mensagem', title: $t('chats.headers.lastMsgTimestamp'),
value: 'lastMsgTimestamp', value: 'lastMsgTimestamp',
options: { format: 'DD/MM/YYYY HH:mm' }, options: { format: 'DD/MM/YYYY HH:mm' },
}, },

View File

@ -7,7 +7,7 @@
v-ripple v-ripple
> >
<v-icon start>mdi-account-box</v-icon> <v-icon start>mdi-account-box</v-icon>
Meus contatos {{ $t("contacts.title") }}
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn <v-btn
size="small" size="small"
@ -27,7 +27,7 @@
<v-text-field <v-text-field
v-model="search" v-model="search"
label="Pesquisar" :label="$t('search')"
outlined outlined
clearable clearable
variant="outlined" variant="outlined"
@ -38,9 +38,9 @@
<v-data-table <v-data-table
:headers="[ :headers="[
{ title: 'Nome', value: 'pushName', sortable: true }, { title: $t('name'), value: 'pushName', sortable: true },
{ {
title: 'Número', title: 'Whatsapp',
value: 'id', value: 'id',
}, },
]" ]"

View File

@ -7,7 +7,7 @@
v-ripple v-ripple
> >
<v-icon start>mdi-account-group</v-icon> <v-icon start>mdi-account-group</v-icon>
Meus Grupos {{ $t("groups.title") }}
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn <v-btn
size="small" size="small"
@ -27,7 +27,7 @@
<v-text-field <v-text-field
v-model="search" v-model="search"
label="Pesquisar" :label="$t('search')"
outlined outlined
clearable clearable
variant="outlined" variant="outlined"
@ -38,10 +38,10 @@
<v-data-table <v-data-table
:headers="[ :headers="[
{ title: 'Nome', value: 'subject' }, { title: $t('name'), value: 'subject' },
{ title: 'ID', value: 'id', align: 'center' }, { title: 'ID', value: 'id', align: 'center' },
{ {
title: 'Criado em', title: $t('groups.headers.creation'),
value: 'creation', value: 'creation',
align: 'center', align: 'center',
}, },

View File

@ -7,7 +7,7 @@
v-ripple v-ripple
> >
<v-icon start>mdi-message-text</v-icon> <v-icon start>mdi-message-text</v-icon>
Mandar mensagem {{ $t("sendMessage.title") }}
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn <v-btn
size="small" size="small"

View File

@ -7,7 +7,7 @@
v-ripple v-ripple
> >
<v-icon start>mdi-account</v-icon> <v-icon start>mdi-account</v-icon>
Nome e Recado {{ $t("profile.title") }}
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn <v-btn
@ -31,23 +31,23 @@
class="flex-grow-1 flex-shrink-0" class="flex-grow-1 flex-shrink-0"
v-model="data.name" v-model="data.name"
:disabled=" loading" :disabled=" loading"
label="Nome" :label="$t('profile.name')"
counter counter
maxlength="25" maxlength="25"
:rules="[ :rules="[
(v) => !!v || 'Nome é obrigatório', (v) => !!v || $t('required', { field: $t('profile.name') }),
(v) => v.length <= 25 || 'Nome deve ter no máximo 25 caracteres', (v) => v.length <= 25 || $t('maxLength', { field: $t('profile.name'), length: 25 }),
]" ]"
></v-text-field> ></v-text-field>
<v-text-field <v-text-field
class="flex-grow-1 flex-shrink-0" class="flex-grow-1 flex-shrink-0"
v-model="data.status" v-model="data.status"
:disabled="loading" :disabled="loading"
label="Recado (Status)" :label="$t('profile.status')"
:rules="[ :rules="[
(v) => !!v || 'Nome é obrigatório', (v) => !!v || $t('required', { field: $t('profile.status') }),
(v) => (v) =>
v.length <= 139 || 'Recado deve ter no máximo 139 caracteres', v.length <= 139 || $t('maxLength', { field: $t('profile.status'), length: 139 }),
]" ]"
counter counter
maxlength="139" maxlength="139"
@ -67,7 +67,7 @@
@click="saveOptions" @click="saveOptions"
variant="tonal" variant="tonal"
> >
Salvar {{ $t("save") }}
</v-btn> </v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>

View File

@ -7,7 +7,7 @@
v-ripple v-ripple
> >
<v-icon start>mdi-shield-account</v-icon> <v-icon start>mdi-shield-account</v-icon>
Privacidade {{ $t("privacy.title") }}
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn <v-btn
size="small" size="small"
@ -29,48 +29,60 @@
<v-select <v-select
v-model="privacyData.last" v-model="privacyData.last"
:items="WAPrivacyValue" :items="WAPrivacyValue"
label="Visto por último" :label="$t('privacy.lastSeen')"
:rules="[(v) => !!v || 'Visto por último é obrigatório']" :rules="[
(v) => !!v || $t('required', { field: $t('privacy.lastSeen') }),
]"
density="comfortable" density="comfortable"
prepend-inner-icon="mdi-clock-outline" prepend-inner-icon="mdi-clock-outline"
></v-select> ></v-select>
<v-select <v-select
v-model="privacyData.online" v-model="privacyData.online"
:items="WAPrivacyOnlineValue" :items="WAPrivacyOnlineValue"
label="Online" :label="$t('privacy.online')"
:rules="[(v) => !!v || 'Online é obrigatório']" :rules="[
(v) => !!v || $t('required', { field: $t('privacy.online') }),
]"
density="comfortable" density="comfortable"
prepend-inner-icon="mdi-cellphone" prepend-inner-icon="mdi-cellphone"
></v-select> ></v-select>
<v-select <v-select
v-model="privacyData.profile" v-model="privacyData.profile"
:items="WAPrivacyValue" :items="WAPrivacyValue"
label="Foto do Perfil" :label="$t('privacy.profilePhoto')"
:rules="[(v) => !!v || 'Foto de Perfil é obrigatório']" :rules="[
(v) => !!v || $t('required', { field: $t('privacy.profilePhoto') }),
]"
density="comfortable" density="comfortable"
prepend-inner-icon="mdi-account-box" prepend-inner-icon="mdi-account-box"
></v-select> ></v-select>
<v-select <v-select
v-model="privacyData.status" v-model="privacyData.status"
:items="WAPrivacyValue" :items="WAPrivacyValue"
label="Recado (Status)" :label="$t('privacy.status')"
:rules="[(v) => !!v || 'Recado é obrigatório']" :rules="[
(v) => !!v || $t('required', { field: $t('privacy.status') }),
]"
density="comfortable" density="comfortable"
prepend-inner-icon="mdi-text-short" prepend-inner-icon="mdi-text-short"
></v-select> ></v-select>
<v-select <v-select
v-model="privacyData.readreceipts" v-model="privacyData.readreceipts"
:items="WAReadReceiptsValue" :items="WAReadReceiptsValue"
label="Confirmação de leitura" :label="$t('privacy.readreceipts')"
:rules="[(v) => !!v || 'Confirmação de leitura é obrigatório']" :rules="[
(v) => !!v || $t('required', { field: $t('privacy.readreceipts') }),
]"
density="comfortable" density="comfortable"
prepend-inner-icon="mdi-check-all" prepend-inner-icon="mdi-check-all"
></v-select> ></v-select>
<v-select <v-select
v-model="privacyData.groupadd" v-model="privacyData.groupadd"
:items="WAPrivacyValue" :items="WAPrivacyValue"
label="Ser adicionado em grupos" :label="$t('privacy.groupadd')"
:rules="[(v) => !!v || 'Ser adicionado em grupos é obrigatório']" :rules="[
(v) => !!v || $t('required', { field: $t('privacy.groupadd') }),
]"
density="comfortable" density="comfortable"
prepend-inner-icon="mdi-account-multiple-plus" prepend-inner-icon="mdi-account-multiple-plus"
></v-select> ></v-select>
@ -97,7 +109,7 @@
@click="savePrivacy" @click="savePrivacy"
variant="tonal" variant="tonal"
> >
Salvar {{ $t("save") }}
</v-btn> </v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
@ -125,46 +137,54 @@ export default {
required: true, required: true,
}, },
}, },
data: () => ({ data() {
AppStore: useAppStore(), return {
expanded: false, AppStore: useAppStore(),
loading: false, expanded: false,
error: false, loading: false,
valid: false, error: false,
WAPrivacyValue: [ valid: false,
{ value: "all", title: "Todos" }, WAPrivacyValue: [
{ value: "contacts", title: "Contatos" }, { value: "all", title: this.$t("privacy.options.all") },
{ value: "contact_blacklist", title: "Contatos exeto os da lista negra" }, { value: "contacts", title: this.$t("privacy.options.contacts") },
{ value: "none", title: "Ninguém" }, {
], value: "contact_blacklist",
WAPrivacyOnlineValue: [ title: this.$t("privacy.options.contactBlacklist"),
{ value: "all", title: "Todos" }, },
{ value: "match_last_seen", title: "Igual ao visto por último" }, { value: "none", title: this.$t("privacy.options.none") },
], ],
WAReadReceiptsValue: [ WAPrivacyOnlineValue: [
{ value: "all", title: "Todos" }, { value: "all", title: this.$t("privacy.options.all") },
{ value: "none", title: "Ninguém" }, {
], value: "match_last_seen",
title: this.$t("privacy.options.matchLastSeen"),
},
],
WAReadReceiptsValue: [
{ value: "all", title: this.$t("privacy.options.all") },
{ value: "none", title: this.$t("privacy.options.none") },
],
privacyData: { privacyData: {
readreceipts: "all", readreceipts: "all",
profile: "all", profile: "all",
status: "all", status: "all",
online: "all", online: "all",
last: "all", last: "all",
groupadd: "all", groupadd: "all",
calladd: "all", calladd: "all",
}, },
defaultChatwootData: { defaultChatwootData: {
readreceipts: "all", readreceipts: "all",
profile: "all", profile: "all",
status: "all", status: "all",
online: "all", online: "all",
last: "all", last: "all",
groupadd: "all", groupadd: "all",
calladd: "all", calladd: "all",
}, },
}), };
},
methods: { methods: {
toggleExpanded() { toggleExpanded() {
if (this.loading) return; if (this.loading) return;
@ -190,7 +210,7 @@ export default {
}, },
async loadPrivacy() { async loadPrivacy() {
try { try {
if(!this.isOpen) return; if (!this.isOpen) return;
this.loading = true; this.loading = true;
this.error = false; this.error = false;
const privacyData = await instanceController.profile.getPrivacy( const privacyData = await instanceController.profile.getPrivacy(

View File

@ -7,7 +7,7 @@
v-ripple v-ripple
> >
<v-icon start>mdi-account-box</v-icon> <v-icon start>mdi-account-box</v-icon>
Foto de Perfil {{ $t("profilePicture.title") }}
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn <v-btn
@ -35,7 +35,7 @@
/> />
<div v-else class="d-flex flex-column align-center"> <div v-else class="d-flex flex-column align-center">
<v-icon size="70"> mdi-account-question </v-icon> <v-icon size="70"> mdi-account-question </v-icon>
Sem foto de perfil {{ $t("profilePicture.noPhoto") }}
</div> </div>
</v-avatar> </v-avatar>
@ -51,7 +51,7 @@
size="50" size="50"
/> />
<v-icon size="50" v-else>mdi-upload</v-icon> <v-icon size="50" v-else>mdi-upload</v-icon>
Selecionar foto {{ $t("profilePicture.upload") }}
</v-card> </v-card>
<v-card <v-card
v-if="instance.instance.profilePictureUrl" v-if="instance.instance.profilePictureUrl"
@ -67,7 +67,7 @@
size="50" size="50"
/> />
<v-icon size="50" v-else>mdi-delete</v-icon> <v-icon size="50" v-else>mdi-delete</v-icon>
Remover foto {{ $t("profilePicture.remove") }}
</v-card> </v-card>
</div> </div>
<input <input

View File

@ -1,14 +1,14 @@
<template> <template>
<v-dialog v-model="dialog" max-width="600px"> <v-dialog v-model="dialog" max-width="600px">
<v-card> <v-card>
<v-card-title>Mandar mensagem</v-card-title> <v-card-title>{{ $t("sendMessage.title") }}</v-card-title>
<v-card-text> <v-card-text>
<v-form v-model="valid"> <v-form v-model="valid">
<v-autocomplete <v-autocomplete
v-model="numbers" v-model="numbers"
multiple multiple
chips chips
label="Para" :label="$t('sendMessage.to')"
:loading="loadingContacts" :loading="loadingContacts"
:items="contacts" :items="contacts"
v-model:search="search" v-model:search="search"
@ -19,7 +19,10 @@
@click="addAndSelect" @click="addAndSelect"
:title="search" :title="search"
></v-list-item> ></v-list-item>
<v-list-item v-else title="Sem contatos"></v-list-item> <v-list-item
v-else
:title="$t('sendMessage.noContacts')"
></v-list-item>
</template> </template>
<template v-slot:chip="{ item }"> <template v-slot:chip="{ item }">
<v-chip class="d-flex gap-1 align-center"> <v-chip class="d-flex gap-1 align-center">
@ -65,7 +68,7 @@
<v-textarea <v-textarea
v-model="message.textMessage.text" v-model="message.textMessage.text"
label="Mensagem" :label="$t('sendMessage.message')"
outlined outlined
dense dense
:rules="[ :rules="[
@ -91,19 +94,25 @@
'paused', 'paused',
]" ]"
density="compact" density="compact"
label="Presença" :label="$t('sendMessage.presence')"
:rules="[(v) => !!v || 'Presença é obrigatória']" :rules="[
(v) =>
!!v || $t('required', { field: $t('sendMessage.presence') }),
]"
:disabled="loading" :disabled="loading"
class="mb-3" class="mb-3"
></v-select> ></v-select>
<v-text-field <v-text-field
v-model="message.options.delay" v-model="message.options.delay"
type="number" type="number"
label="Delay" :label="$t('sendMessage.delay')"
density="compact" density="compact"
:hint="`Delay em milisegundos :hint="`${$t('sendMessage.delayHint')}
(${(message.options.delay / 1000).toFixed(1)} segundos)`" (${(message.options.delay / 1000).toFixed(1)} segundos)`"
:rules="[(v) => !!v || 'Delay é obrigatório']" :rules="[
(v) =>
!!v || $t('required', { field: $t('sendMessage.delay') }),
]"
:disabled="loading" :disabled="loading"
class="mb-3" class="mb-3"
></v-text-field> ></v-text-field>
@ -119,7 +128,9 @@
</v-alert> </v-alert>
</v-card-text> </v-card-text>
<v-card-actions> <v-card-actions>
<v-btn text @click="dialog = false" :disabled="loading">Fechar</v-btn> <v-btn text @click="dialog = false" :disabled="loading">{{
$t("close")
}}</v-btn>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn <v-btn
color="success" color="success"
@ -128,7 +139,7 @@
:disabled="!valid" :disabled="!valid"
:loading="loading" :loading="loading"
> >
Enviar {{ $t("sendMessage.send") }}
</v-btn> </v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
@ -196,9 +207,7 @@ export default {
this.success = { this.success = {
messageId: messagesId.join(", "), messageId: messagesId.join(", "),
message: `Mensage${ message: this.$t("sendMessage.success", this.numbers.length),
this.numbers.length != 1 ? "ns" : "m"
} enviada com sucesso`,
}; };
this.message = defaultMessage(); this.message = defaultMessage();
this.numbers = []; this.numbers = [];

View File

@ -18,10 +18,12 @@ export default {
noInstances: "No instances found", noInstances: "No instances found",
unknown: "Unknown", unknown: "Unknown",
required: "{field} is required", required: "{field} is required",
maxLength: "{field} must have a maximum of {length} characters",
https: "{field} must start with https://", https: "{field} must start with https://",
httpHttps: "{field} must start with http:// or https://", httpHttps: "{field} must start with http:// or https://",
enabled: "Enabled", enabled: "Enabled",
events: "Events", events: "Events",
name: "Name",
version: { version: {
availableFrom: "Available from version {version}", availableFrom: "Available from version {version}",
}, },
@ -113,4 +115,61 @@ export default {
closed: "Closed", closed: "Closed",
} }
}, },
sendMessage: {
title: "Send message",
to: "To",
noContacts: "No contacts",
message: "Message",
presence: "Presence",
delay: "Delay",
delayHelp: "Delay in milliseconds",
send: "Send",
success: "Message sent successfully | Messages sent successfully",
},
phoneHasWhatsApp: {
title: "Has WhatsApp?",
phone: "WhatsApp number",
verify: "Verify",
exists: "WhatsApp found",
notExists: "WhatsApp not found",
invalid: "Invalid number",
},
contacts: {
title: "My contacts",
},
groups: {
title: "My groups",
headers: { creation: "Created at", }
},
chats: {
title: "My chats",
headers: { lastMsgTimestamp: "Last message", }
},
profile: {
title: "Name and Status",
name: "Name",
status: "Status"
},
profilePicture: {
title: "Profile Picture",
noPhoto: "No profile photo",
upload: "Select Photo",
remove: "Remove Photo",
},
privacy: {
title: "Privacy",
lastSeen: "Last Seen",
online: "Online",
profilePhoto: "Profile Photo",
status: "Status",
readreceipts: "Read Receipts",
groupadd: "Be Added to Groups",
options: {
all: "Everyone",
contacts: "My Contacts",
contactBlacklist: "My Contacts, Except Blacklisted",
matchLastSeen: "Match Last Seen",
none: "Nobody",
}
}
} }

View File

@ -18,10 +18,12 @@ export default {
noInstances: "Nenhuma instância encontrada", noInstances: "Nenhuma instância encontrada",
unknown: "Desconhecido", unknown: "Desconhecido",
required: "{field} é obrigatório", required: "{field} é obrigatório",
maxLength: "{field} deve ter no máximo {length} caracteres",
https: "{field} deve começar com https://", https: "{field} deve começar com https://",
httpHttps: "{field} deve começar com http:// ou https://", httpHttps: "{field} deve começar com http:// ou https://",
enabled: "Habilitado", enabled: "Habilitado",
events: "Eventos", events: "Eventos",
name: "Nome",
version: { version: {
availableFrom: "Disponível a partir da versão {version}", availableFrom: "Disponível a partir da versão {version}",
}, },
@ -112,5 +114,62 @@ export default {
paused: "Pausado", paused: "Pausado",
closed: "Fechado", closed: "Fechado",
} }
},
sendMessage: {
title: "Enviar mensagem",
to: "Para",
noContacts: "Sem contatos",
message: "Mensagem",
presence: "Presença",
delay: "Atraso",
delayHelp: "Atraso em milisegundos",
send: "Enviar",
success: "Mensagem enviada com sucesso | Mensagens enviadas com sucesso",
},
phoneHasWhatsApp: {
title: "Tem WhatsApp?",
phone: "Número do WhatsApp",
verify: "Consultar",
exists: "WhatsApp encontrado",
notExists: "WhatsApp não encontrado",
invalid: "Número inválido",
},
contacts: {
title: "Meus contatos",
},
groups: {
title: "Meus grupos",
headers: { creation: "Criado em", }
},
chats: {
title: "Minhas conversas",
headers: { lastMsgTimestamp: "Última mensagem", }
},
profile: {
title: "Nome e Recado",
name: "Name",
status: "Recado (status)"
},
profilePicture: {
title: "Foto de perfil",
noPhoto: "Sem foto de perfil",
upload: "Selecionar Foto",
remove: "Remover Foto",
},
privacy: {
title: "Privacidade",
lastSeen: "Visto por último",
online: "Online",
profilePhoto: "Foto de perfil",
status: "Recado (status)",
readreceipts: "Confirmação de leitura",
groupadd: "Ser adicionado a grupos",
options: {
all: "Todos",
contacts: "Meus contatos",
contactBlacklist: "Meus contatos, exceto os da lista negra",
matchLastSeen: "Igual ao visto por último",
none: "Ninguém",
}
} }
} }

View File

@ -37,7 +37,7 @@
<div class="d-flex gap-2 flex-wrap mb-2"> <div class="d-flex gap-2 flex-wrap mb-2">
<v-text-field <v-text-field
v-model="search" v-model="search"
label="Pesquisar" :label="$t('search')"
density="comfortable" density="comfortable"
variant="outlined" variant="outlined"
hide-details hide-details