Skip to content

Commit 790755d

Browse files
translate instance root components
body, header, connectPhone
1 parent c0f3dcd commit 790755d

File tree

6 files changed

+59
-27
lines changed

6 files changed

+59
-27
lines changed

src/components/instance/InstanceBody.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<v-tabs v-model="tab" background-color="transparent" color="primary" grow>
33
<v-tab v-for="tab in tabs" :key="tab.id" :value="tab.id">
44
<v-icon start>{{ tab.icon }}</v-icon>
5-
{{ tab.title }}
5+
{{ $t(`instanceTabs.${tab.id}`) }}
66
</v-tab>
77
</v-tabs>
88

@@ -62,7 +62,6 @@ export default {
6262
{
6363
id: "settings",
6464
icon: "mdi-cog",
65-
title: "Configurações",
6665
components: [
6766
"Options",
6867
"Webhook",
@@ -75,7 +74,6 @@ export default {
7574
{
7675
id: "message",
7776
icon: "mdi-message",
78-
title: "Mensagens",
7977
components: [
8078
"OpenSendMessage",
8179
"HasWhatsapp",
@@ -87,7 +85,6 @@ export default {
8785
{
8886
id: "profile",
8987
icon: "mdi-account",
90-
title: "Perfil",
9188
components: [
9289
"ConnectionAlert",
9390
"BasicInfo",

src/components/instance/InstanceHeader.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
size="small"
6464
>
6565
<v-icon start>mdi-restart</v-icon>
66-
{{ restart.success ? "Reiniciada!" : "Reiniciar" }}
66+
{{ restart.success ? `${$t("restarted")}` : `${$t("restart")}` }}
6767
</v-btn>
6868
<v-btn
6969
@click="disconnectInstance"
@@ -76,7 +76,7 @@
7676
size="small"
7777
>
7878
<v-icon start>mdi-cellphone-nfc-off</v-icon>
79-
{{ disconnect.confirm ? "Tem Certeza?" : "Desconectar" }}
79+
{{ disconnect.confirm ? `${$t("sure")}` : `${$t("disconnect")}` }}
8080
</v-btn>
8181
</div>
8282
</v-card>
@@ -157,10 +157,8 @@ export default {
157157
computed: {
158158
owner() {
159159
if (!this.instance?.instance?.owner)
160-
return (
161-
this.statusMapper[this.instance.instance.status]?.text ||
162-
"Desconhecido"
163-
);
160+
return this.$t(`status.${this.instance.instance.status}`) || this.$t("unknown");
161+
164162
return (this.instance?.instance?.owner || "").split("@")[0];
165163
},
166164
},

src/components/modal/ConnectPhone.vue

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
<template>
2-
<v-card v-if="instance.instance?.status != 'open'" @click="startConnect" elevation="0">
2+
<v-card
3+
v-if="instance.instance?.status != 'open'"
4+
@click="startConnect"
5+
elevation="0"
6+
>
37
<v-alert
48
icon="mdi-qrcode-scan"
59
color="deep-orange-darken-2"
610
class="text-white"
711
>
812
<div class="d-flex justify-space-between align-center flex-wrap">
9-
<b>Telefone não conectado</b>
10-
<v-btn @click="startConnect" size="small"> Conectar </v-btn>
13+
<b>{{ $t("connectPhone.title") }}</b>
14+
<v-btn @click="startConnect" size="small">
15+
{{ $t("connection.action") }}
16+
</v-btn>
1117
</div>
1218
</v-alert>
1319
</v-card>
14-
<v-dialog v-model="dialog" max-width="350px">
20+
<v-dialog v-model="dialog" max-width="350px" :persistent="loading">
1521
<v-card :loading="loading && qrCode">
1622
<v-card-text class="pt-6">
1723
<v-img v-if="qrCode" :src="qrCode" width="300px" height="300px" />
@@ -38,7 +44,7 @@
3844
class="mt-2"
3945
>
4046
<v-icon start size="small">mdi-refresh</v-icon>
41-
Atualizar
47+
{{ $t("refresh") }}
4248
</v-btn>
4349

4450
<v-alert type="error" v-if="error" class="mt-2">
@@ -47,7 +53,9 @@
4753
</v-card-text>
4854
<v-card-actions>
4955
<v-spacer></v-spacer>
50-
<v-btn text @click="dialog = false" :disabled="loading"> Cancel </v-btn>
56+
<v-btn text @click="dialog = false" :disabled="loading">
57+
{{ $t("cancel") }}
58+
</v-btn>
5159
<v-spacer></v-spacer>
5260
</v-card-actions>
5361
</v-card>

src/components/modal/Settings.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
</v-card-text>
3333
<v-card-actions>
3434
<div class="d-flex flex-wrap justify-space-between w-100 align-center">
35-
<v-btn size="small" text @click="showAbout"> {{ $t('about.title') }} </v-btn>
35+
<v-btn size="small" text @click="showAbout">
36+
{{ $t("about.title") }}
37+
</v-btn>
3638
<div class="d-flex justify-end flex-grow-1 gap-1">
3739
<v-btn
3840
v-if="!!AppStore.connection.host"
@@ -72,16 +74,18 @@
7274
:disabled="!valid"
7375
:loading="loading"
7476
>
75-
{{ $t('connection.action') }}
76-
</v-btn>
77+
{{ $t("connection.action") }}
78+
</v-btn>
7779
</div>
7880
</div>
7981
</v-card-actions>
8082
</v-card>
8183

8284
<v-card class="mt-2" v-if="connectionsList && connectionsList.length > 1">
8385
<v-card-text>
84-
<h3 class="mb-4">{{ $t('connection.saved') }}</h3>
86+
<h3 class="mb-4">
87+
{{ $t("connection.saved", connectionsList.length) }}
88+
</h3>
8589
<v-list>
8690
<v-list-item
8791
v-for="conect in connectionsList"

src/i18n/en.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
1+
// src/i18n/en.js
22
import { en } from 'vuetify/locale'
33

4-
54
export default {
65
$vuetify: { ...en },
76
all: "All",
87
close: "Close",
8+
cancel: "Cancel",
9+
restart: "Restart",
10+
restarted: "Restarted",
11+
refresh: "Refresh",
12+
disconnect: "Disconnect",
13+
sure: "Sure?",
914
instance: "Instance | Instances",
1015
search: "Search",
1116
loading: "Loading",
1217
noInstances: "No instances found",
18+
unknown: "Unknown",
1319
status: {
1420
close: "Disconnected",
1521
connecting: "Connecting",
@@ -28,5 +34,13 @@ export default {
2834
title: "Configure connection",
2935
action: "Connect",
3036
saved: "Connection saved | Connections saved",
37+
},
38+
instanceTabs: {
39+
settings: "Settings",
40+
message: "Messages",
41+
profile: "Profile",
42+
},
43+
connectPhone: {
44+
title: "Phone not connected"
3145
}
3246
}

src/i18n/pt.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
1+
// src/i18n/pt.js
22
import { pt } from 'vuetify/locale'
33

4-
54
export default {
65
$vuetify: { ...pt },
76
all: "Todo | Todos",
87
close: "Fechar",
8+
cancel: "Cancelar",
9+
restart: "Reiniciar",
10+
restarted: "Reiniciada",
11+
refresh: "Atualizar",
12+
disconnect: "Desconectar",
13+
sure: "Tem certeza?",
914
instance: "Instância | Instâncias",
1015
search: "Pesquisar",
1116
loading: "Carregando",
1217
noInstances: "Nenhuma instância encontrada",
18+
unknown: "Desconhecido",
1319
status: {
1420
close: "Desconectado",
1521
connecting: "Conectando",
@@ -28,8 +34,13 @@ export default {
2834
title: "Configurar conexão",
2935
action: "Conectar",
3036
saved: "Conexão salva | Conexões salvas",
37+
},
38+
instanceTabs: {
39+
settings: "Configurações",
40+
message: "Mensagens",
41+
profile: "Perfil",
42+
},
43+
connectPhone: {
44+
title: "Telefone não conectado"
3145
}
32-
33-
34-
3546
}

0 commit comments

Comments
 (0)