init i18n

This commit is contained in:
Gabriel Pastori
2023-12-14 12:16:21 -03:00
parent be7fea49a1
commit c0f3dcdc50
13 changed files with 247 additions and 35 deletions

View File

@@ -26,16 +26,29 @@
}}
</p>
</div>
<v-chip
size="x-small"
color="grey"
class="flex-shrink-0"
>
<v-chip size="x-small" color="grey" class="flex-shrink-0">
<b>{{ AppStore.version }}</b>
</v-chip>
</div>
</v-chip>
<v-icon v-else color="error"> mdi-alert-circle </v-icon>
<v-menu>
<template v-slot:activator="{ props }">
<v-btn class="ml-1" v-bind="props" icon>
<v-icon>mdi-translate</v-icon>
</v-btn>
</template>
<v-list :value="currentLanguage">
<v-list-item
v-for="lang in availableLanguages"
:key="lang"
@click="changei18n(lang)"
:disabled="lang === currentLanguage"
>
<v-list-item-title>{{ lang }}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
<v-btn @click="openSettings" icon>
<v-icon>mdi-cog</v-icon>
</v-btn>
@@ -61,6 +74,10 @@ export default {
SettingsModal,
},
methods: {
changei18n(locale) {
this.$vuetify.locale.current = locale;
window.localStorage.setItem("locale", locale);
},
toggleTheme() {
const theme = this.theme.global.current.dark ? "light" : "dark";
this.theme.global.name = theme;
@@ -91,6 +108,12 @@ export default {
dark() {
return this.theme.global.current.dark;
},
availableLanguages() {
return this.$i18n.availableLocales;
},
currentLanguage() {
return this.$i18n.locale;
},
},
async mounted() {
try {

View File

@@ -9,7 +9,7 @@
color="blue"
>
<v-icon start> mdi-information </v-icon>
Sobre
{{ $t("about.title") }}
</v-btn>
<v-btn
@click="contribute"
@@ -18,7 +18,7 @@
color="light-blue-lighten-1"
>
<v-icon start>mdi-hand-coin</v-icon>
Contribua com o projeto
{{ $t("contribute.button") }}
</v-btn>
<p style="font-size: 12px" class="text-disabled">v{{ version }}</p>
</div>