Browse Source

Moving locale button into its own component

Fixing a translation error
pull/976/head
Collin Brown 4 years ago
parent
commit
bec857120f
3 changed files with 36 additions and 27 deletions
  1. 2
      frontend/components/organisms/annotation/MultiClassClassification.vue
  2. 31
      frontend/components/organisms/layout/LocaleMenu.vue
  3. 30
      frontend/components/organisms/layout/TheHeader.vue

2
frontend/components/organisms/annotation/MultiClassClassification.vue

@ -3,7 +3,7 @@
v-model="annotatedLabels"
:items="labels"
item-text="text"
:label="$t('label.label')"
:label="$t('labels.labels')"
hide-selected
chips
multiple

31
frontend/components/organisms/layout/LocaleMenu.vue

@ -0,0 +1,31 @@
<template>
<v-menu
open-on-hover
offset-y
>
<template v-slot:activator="{ on }">
<v-btn
text
v-on="on"
>
{{ $i18n.locale }}
<v-icon>mdi-menu-down</v-icon>
</v-btn>
</template>
<v-list
v-for="locale in $i18n.locales"
:key="locale.code"
>
<nuxt-link
class="v-list-item v-list-item--link theme--dark"
:to="switchLocalePath(locale.code)"
>
{{ locale.name }}
</nuxt-link>
</v-list>
</v-menu>
</template>
<script>
export default {}
</script>

30
frontend/components/organisms/layout/TheHeader.vue

@ -29,31 +29,7 @@
</v-btn>
<div class="flex-grow-1" />
<the-color-mode-switcher />
<v-menu
open-on-hover
offset-y
>
<template v-slot:activator="{ on }">
<v-btn
text
v-on="on"
>
{{ $i18n.locale }}
<v-icon>mdi-menu-down</v-icon>
</v-btn>
</template>
<v-list
v-for="locale in $i18n.locales"
:key="locale.code"
>
<nuxt-link
class="v-list-item v-list-item--link theme--dark"
:to="switchLocalePath(locale.code)"
>
{{ locale.name }}
</nuxt-link>
</v-list>
</v-menu>
<locale-menu />
<v-btn
v-if="isAuthenticated"
text
@ -121,10 +97,12 @@
<script>
import { mapGetters, mapActions } from 'vuex'
import TheColorModeSwitcher from '@/components/organisms/layout/TheColorModeSwitcher'
import LocaleMenu from '@/components/organisms/layout/LocaleMenu'
export default {
components: {
TheColorModeSwitcher
TheColorModeSwitcher,
LocaleMenu
},
data() {

Loading…
Cancel
Save