api-client/components/smart/ChangeLanguage.vue

38 lines
985 B
Vue
Raw Normal View History

2021-07-02 05:01:29 +00:00
<template>
2021-08-02 15:27:18 +00:00
<span class="inline-flex">
2021-08-03 16:05:01 +00:00
<span class="select-wrapper">
<tippy
ref="language"
interactive
tabindex="-1"
trigger="click"
theme="popover"
arrow
>
2021-08-03 16:05:01 +00:00
<template #trigger>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
:title="$t('settings.choose_language')"
class="pr-8"
outline
2021-08-04 05:50:23 +00:00
icon="language"
2021-08-03 16:05:01 +00:00
:label="`${
$i18n.locales.find(({ code }) => code == $i18n.locale).name
}`"
/>
</template>
<nuxt-link
v-for="(locale, index) in $i18n.locales.filter(
({ code }) => code !== $i18n.locale
)"
:key="`locale-${index}`"
:to="switchLocalePath(locale.code)"
@click="$refs.language.tippy().hide()"
>
<SmartItem :label="locale.name" />
</nuxt-link>
</tippy>
</span>
2021-07-02 05:01:29 +00:00
</span>
</template>