2022-11-28 09:58:29 +03:00
|
|
|
<script lang="ts" setup>
|
2022-11-28 19:49:30 +03:00
|
|
|
import type { ComputedRef } from 'vue'
|
2022-11-29 09:29:09 +03:00
|
|
|
import type { LocaleObject } from '#i18n'
|
2022-11-28 09:58:29 +03:00
|
|
|
|
2022-11-29 09:29:09 +03:00
|
|
|
const { locale, t, setLocale } = useI18n()
|
|
|
|
const { locales } = useI18n() as { locales: ComputedRef<LocaleObject[]> }
|
2022-11-28 09:58:29 +03:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2022-11-29 01:57:27 +03:00
|
|
|
<CommonTooltip :content="t('nav_footer.select_language')">
|
2022-11-28 09:58:29 +03:00
|
|
|
<CommonDropdown>
|
2022-11-30 00:24:26 +03:00
|
|
|
<button flex :aria-label="t('nav_footer.select_language')">
|
2022-11-28 09:58:29 +03:00
|
|
|
<div i-ri:earth-line text-lg />
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<template #popper>
|
|
|
|
<CommonDropdownItem
|
2022-11-28 19:49:30 +03:00
|
|
|
v-for="item in locales"
|
|
|
|
:key="item.code"
|
|
|
|
:checked="item.code === locale"
|
2022-11-30 03:22:35 +03:00
|
|
|
@click="setLocale(item.code)"
|
2022-11-28 09:58:29 +03:00
|
|
|
>
|
2022-11-28 19:49:30 +03:00
|
|
|
{{ item.name }}
|
2022-11-28 09:58:29 +03:00
|
|
|
</CommonDropdownItem>
|
|
|
|
</template>
|
|
|
|
</CommonDropdown>
|
|
|
|
</CommonTooltip>
|
|
|
|
</template>
|