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-icon start>mdi-account-question</v-icon>
Tem Whatsapp?
{{ $t("phoneHasWhatsApp.title") }}
<v-spacer></v-spacer>
<v-btn
size="small"
@ -27,18 +27,20 @@
<v-text-field
v-model="phone"
label="Número"
:label="$t('phoneHasWhatsApp.phone')"
outlined
clearable
variant="outlined"
density="compact"
class=" mt-3"
class="mt-3"
hint="DDI + DDD + Número"
/>
<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">
@ -55,7 +57,7 @@
@click="verifyPhone"
variant="tonal"
>
Consultar
{{ $t("phoneHasWhatsApp.verify") }}
</v-btn>
</v-card-actions>
</v-card>
@ -95,7 +97,7 @@ export default {
this.response = false;
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(
this.instance.instance.instanceName,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -18,10 +18,12 @@ export default {
noInstances: "No instances found",
unknown: "Unknown",
required: "{field} is required",
maxLength: "{field} must have a maximum of {length} characters",
https: "{field} must start with https://",
httpHttps: "{field} must start with http:// or https://",
enabled: "Enabled",
events: "Events",
name: "Name",
version: {
availableFrom: "Available from version {version}",
},
@ -113,4 +115,61 @@ export default {
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",
unknown: "Desconhecido",
required: "{field} é obrigatório",
maxLength: "{field} deve ter no máximo {length} caracteres",
https: "{field} deve começar com https://",
httpHttps: "{field} deve começar com http:// ou https://",
enabled: "Habilitado",
events: "Eventos",
name: "Nome",
version: {
availableFrom: "Disponível a partir da versão {version}",
},
@ -112,5 +114,62 @@ export default {
paused: "Pausado",
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">
<v-text-field
v-model="search"
label="Pesquisar"
:label="$t('search')"
density="comfortable"
variant="outlined"
hide-details