api-client/components/smart/ChangeLanguage.vue

32 lines
835 B
Vue
Raw Normal View History

2021-07-02 05:01:29 +00:00
<template>
<span>
<tippy
ref="language"
2021-07-03 13:14:58 +00:00
tabindex="-1"
2021-07-02 05:01:29 +00:00
trigger="click"
theme="popover"
arrow
:animate-fill="false"
>
<template #trigger>
<SmartItem
2021-07-03 13:14:58 +00:00
v-tippy="{ theme: 'tooltip' }"
:title="$t('choose_language')"
:label="`${
$i18n.locales.find(({ code }) => code == $i18n.locale).country
2021-07-03 13:14:58 +00:00
| formatCountry
} ${$i18n.locales.find(({ code }) => code == $i18n.locale).name}`"
/>
2021-07-02 05:01:29 +00:00
</template>
<SmartItem
2021-07-02 05:01:29 +00:00
v-for="locale in $i18n.locales.filter(
({ code }) => code !== $i18n.locale
)"
:key="locale.code"
:to="switchLocalePath(locale.code).toString()"
:label="`${locale.country | formatCountry} ${locale.name}`"
/>
2021-07-02 05:01:29 +00:00
</tippy>
</span>
</template>