|
|
@ -3,9 +3,13 @@ import VPFlyout from './VPFlyout.vue'
|
|
|
|
import VPMenuLink from './VPMenuLink.vue'
|
|
|
|
import VPMenuLink from './VPMenuLink.vue'
|
|
|
|
import { useData } from '../composables/data'
|
|
|
|
import { useData } from '../composables/data'
|
|
|
|
import { useLangs } from '../composables/langs'
|
|
|
|
import { useLangs } from '../composables/langs'
|
|
|
|
|
|
|
|
import VPSocialLink from "./VPSocialLink.vue";
|
|
|
|
|
|
|
|
// import { computed } from 'vue'
|
|
|
|
|
|
|
|
|
|
|
|
const { theme } = useData()
|
|
|
|
const { theme } = useData()
|
|
|
|
const { localeLinks, currentLang } = useLangs({ correspondingLink: true })
|
|
|
|
const { localeLinks, currentLang } = useLangs({ correspondingLink: true })
|
|
|
|
|
|
|
|
// for helping translate
|
|
|
|
|
|
|
|
// const repoLink = computed(() => currentLang.value.repo || (localeLinks.value.length > 1 && localeLinks.value.some(l => !!l.repo)))
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
@ -16,10 +20,20 @@ const { localeLinks, currentLang } = useLangs({ correspondingLink: true })
|
|
|
|
:label="theme.langMenuLabel || 'Change language'"
|
|
|
|
:label="theme.langMenuLabel || 'Change language'"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div class="items">
|
|
|
|
<div class="items">
|
|
|
|
<p class="title">{{ currentLang.label }}</p>
|
|
|
|
<div v-if="currentLang.repo">
|
|
|
|
|
|
|
|
<div class="menu-item">
|
|
|
|
|
|
|
|
<p class="title">{{ currentLang.label }}</p>
|
|
|
|
|
|
|
|
<VPSocialLink icon="github" :link="currentLang.repo.link" :ariaLabel="currentLang.repo.title" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<p v-else class="title">{{ currentLang.label }}</p>
|
|
|
|
|
|
|
|
|
|
|
|
<template v-for="locale in localeLinks" :key="locale.link">
|
|
|
|
<template v-for="locale in localeLinks" :key="locale.link">
|
|
|
|
<VPMenuLink :item="locale" />
|
|
|
|
<div v-if="locale.repo" class="menu-item">
|
|
|
|
|
|
|
|
<VPMenuLink :item="locale" />
|
|
|
|
|
|
|
|
<VPSocialLink icon="github" :link="locale.repo.link" :ariaLabel="locale.repo.title" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<VPMenuLink v-else :item="locale" />
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</VPFlyout>
|
|
|
|
</VPFlyout>
|
|
|
@ -30,6 +44,13 @@ const { localeLinks, currentLang } = useLangs({ correspondingLink: true })
|
|
|
|
display: none;
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.menu-item {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@media (min-width: 1280px) {
|
|
|
|
@media (min-width: 1280px) {
|
|
|
|
.VPNavBarTranslations {
|
|
|
|
.VPNavBarTranslations {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|