Skip to content

Commit c0f3dcd

Browse files
init i18n
1 parent be7fea4 commit c0f3dcd

File tree

13 files changed

+247
-35
lines changed

13 files changed

+247
-35
lines changed

package-lock.json

Lines changed: 94 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"vite": "^4.2.0",
3838
"vite-plugin-vuetify": "^1.0.0",
3939
"vue": "^3.2.0",
40+
"vue-i18n": "^9.8.0",
4041
"vue-router": "^4.0.0",
4142
"vue3-markdown": "^1.1.9",
4243
"vuetify": "^3.4.0"

src/components/instance/settings/Typebot.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@
100100
class="mb-3"
101101
:rules="[
102102
(v) => {
103-
if (!v) return 'Tempo de expiração é obrigatório';
103+
if (v === '' || v === undefined)
104+
return 'Tempo de expiração é obrigatório';
104105
return true;
105106
},
106107
]"

src/components/modal/About.vue

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,7 @@
5050
necessário que o servidor da Evolution API seja acessado através de
5151
uma conexão segura (HTTPS).
5252
</v-alert>
53-
54-
<h3 class="mt-5 mb-2">Limitações do Projeto</h3>
55-
<p>
56-
Como um projeto open-source mantido por voluntários, não há
57-
garantias de atualizações futuras. A independência do Evolution
58-
Manager em relação à Evolution API significa que alterações na API
59-
podem afetar a funcionalidade do Manager.
60-
</p>
61-
53+
6254
<span class="mt-5 mb-2 text-disabled">Versão: {{ version }}</span>
6355
</div>
6456
</v-card-text>

src/components/modal/Contribute.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<v-card>
44
<v-card-text>
55
<div class="d-flex flex-column align-center">
6-
<h4>Contribua via PIX</h4>
6+
<h4>{{$t('contribute.via')}} PIX</h4>
77
<v-img
88
src="@/assets/pix.svg"
99
height="300px"
@@ -20,7 +20,7 @@
2020
</v-card-text>
2121
<v-card-actions>
2222
<v-spacer></v-spacer>
23-
<v-btn text @click="dialog = false" :disabled="loading"> Fechar </v-btn>
23+
<v-btn text @click="dialog = false" :disabled="loading"> {{ $t('close') }} </v-btn>
2424
<v-spacer></v-spacer>
2525
</v-card-actions>
2626
</v-card>

src/components/modal/Settings.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<v-card>
88
<v-card-text>
99
<v-form v-model="valid">
10-
<h3 class="mb-4">Configurar conexão</h3>
10+
<h3 class="mb-4">{{ $t("connection.title") }}</h3>
1111
<v-text-field
1212
v-model="connection.host"
1313
label="URL"
@@ -32,7 +32,7 @@
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"> Sobre </v-btn>
35+
<v-btn size="small" text @click="showAbout"> {{ $t('about.title') }} </v-btn>
3636
<div class="d-flex justify-end flex-grow-1 gap-1">
3737
<v-btn
3838
v-if="!!AppStore.connection.host"
@@ -72,16 +72,16 @@
7272
:disabled="!valid"
7373
:loading="loading"
7474
>
75-
Conectar
76-
</v-btn>
75+
{{ $t('connection.action') }}
76+
</v-btn>
7777
</div>
7878
</div>
7979
</v-card-actions>
8080
</v-card>
8181

8282
<v-card class="mt-2" v-if="connectionsList && connectionsList.length > 1">
8383
<v-card-text>
84-
<h3 class="mb-4">Conexões salvas</h3>
84+
<h3 class="mb-4">{{ $t('connection.saved') }}</h3>
8585
<v-list>
8686
<v-list-item
8787
v-for="conect in connectionsList"

src/i18n/en.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
import { en } from 'vuetify/locale'
3+
4+
5+
export default {
6+
$vuetify: { ...en },
7+
all: "All",
8+
close: "Close",
9+
instance: "Instance | Instances",
10+
search: "Search",
11+
loading: "Loading",
12+
noInstances: "No instances found",
13+
status: {
14+
close: "Disconnected",
15+
connecting: "Connecting",
16+
open: "Connected",
17+
},
18+
about: {
19+
title: "About",
20+
version: "Version",
21+
},
22+
contribute: {
23+
title: "Contribute",
24+
via: "Contribute via",
25+
button: "Contribute",
26+
},
27+
connection: {
28+
title: "Configure connection",
29+
action: "Connect",
30+
saved: "Connection saved | Connections saved",
31+
}
32+
}

src/i18n/pt.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
import { pt } from 'vuetify/locale'
3+
4+
5+
export default {
6+
$vuetify: { ...pt },
7+
all: "Todo | Todos",
8+
close: "Fechar",
9+
instance: "Instância | Instâncias",
10+
search: "Pesquisar",
11+
loading: "Carregando",
12+
noInstances: "Nenhuma instância encontrada",
13+
status: {
14+
close: "Desconectado",
15+
connecting: "Conectando",
16+
open: "Conectado",
17+
},
18+
about: {
19+
title: "Sobre",
20+
version: "Versão",
21+
},
22+
contribute: {
23+
title: "Contribuir",
24+
via: "Contribua via",
25+
button: "Contribua",
26+
},
27+
connection: {
28+
title: "Configurar conexão",
29+
action: "Conectar",
30+
saved: "Conexão salva | Conexões salvas",
31+
}
32+
33+
34+
35+
}

src/layouts/default/AppBar.vue

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,29 @@
2626
}}
2727
</p>
2828
</div>
29-
<v-chip
30-
size="x-small"
31-
color="grey"
32-
class="flex-shrink-0"
33-
>
29+
<v-chip size="x-small" color="grey" class="flex-shrink-0">
3430
<b>{{ AppStore.version }}</b>
3531
</v-chip>
3632
</div>
3733
</v-chip>
3834
<v-icon v-else color="error"> mdi-alert-circle </v-icon>
35+
<v-menu>
36+
<template v-slot:activator="{ props }">
37+
<v-btn class="ml-1" v-bind="props" icon>
38+
<v-icon>mdi-translate</v-icon>
39+
</v-btn>
40+
</template>
41+
<v-list :value="currentLanguage">
42+
<v-list-item
43+
v-for="lang in availableLanguages"
44+
:key="lang"
45+
@click="changei18n(lang)"
46+
:disabled="lang === currentLanguage"
47+
>
48+
<v-list-item-title>{{ lang }}</v-list-item-title>
49+
</v-list-item>
50+
</v-list>
51+
</v-menu>
3952
<v-btn @click="openSettings" icon>
4053
<v-icon>mdi-cog</v-icon>
4154
</v-btn>
@@ -61,6 +74,10 @@ export default {
6174
SettingsModal,
6275
},
6376
methods: {
77+
changei18n(locale) {
78+
this.$vuetify.locale.current = locale;
79+
window.localStorage.setItem("locale", locale);
80+
},
6481
toggleTheme() {
6582
const theme = this.theme.global.current.dark ? "light" : "dark";
6683
this.theme.global.name = theme;
@@ -91,6 +108,12 @@ export default {
91108
dark() {
92109
return this.theme.global.current.dark;
93110
},
111+
availableLanguages() {
112+
return this.$i18n.availableLocales;
113+
},
114+
currentLanguage() {
115+
return this.$i18n.locale;
116+
},
94117
},
95118
async mounted() {
96119
try {

src/layouts/default/AppFooter.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
color="blue"
1010
>
1111
<v-icon start> mdi-information </v-icon>
12-
Sobre
12+
{{ $t("about.title") }}
1313
</v-btn>
1414
<v-btn
1515
@click="contribute"
@@ -18,7 +18,7 @@
1818
color="light-blue-lighten-1"
1919
>
2020
<v-icon start>mdi-hand-coin</v-icon>
21-
Contribua com o projeto
21+
{{ $t("contribute.button") }}
2222
</v-btn>
2323
<p style="font-size: 12px" class="text-disabled">v{{ version }}</p>
2424
</div>

0 commit comments

Comments
 (0)