Merge pull request #47 from ThibaultNocchi/better_i18n

Localizations fix on nav drawer
This commit is contained in:
Julien Machiels 2020-09-06 15:18:26 +02:00 committed by GitHub
commit 9fb919a07f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 24 deletions

View File

@ -7,8 +7,9 @@
</template>
<v-list>
<v-list-item
v-for="(item, index) in menuItems"
v-for="(item, index) in $i18n.locales"
:key="index"
:input-value="item.code === $i18n.locale"
@click="$i18n.setLocale(item.code)"
>
<v-list-item-title>{{ item.name }}</v-list-item-title>
@ -16,17 +17,3 @@
</v-list>
</v-menu>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
computed: {
menuItems: {
get() {
return this.$i18n.locales;
}
}
}
});
</script>

View File

@ -82,25 +82,32 @@ interface NavigationDrawerItem {
export default Vue.extend({
data() {
return {
items: [
clipped: true,
drawer: true,
libraries: {},
miniVariant: false,
title: 'Jellyfin'
};
},
computed: {
items() {
return [
{
icon: 'mdi-home',
title: this.$t('home'),
to: '/'
}
],
configItems: [
];
},
configItems() {
return [
{
icon: 'mdi-cog',
title: this.$t('settings'),
to: '/settings'
}
],
clipped: true,
drawer: !this.$vuetify.breakpoint.mobile,
libraries: {},
title: 'Jellyfin'
};
];
}
},
async beforeMount() {
const userViewsRequest = await this.$userViewsApi.getUserViews({