ChangeLanguage.vue (hoppscotch-2.0.0) | : | ChangeLanguage.vue (hoppscotch-2.1.0) | ||
---|---|---|---|---|
<template> | <template> | |||
<span class="inline-flex"> | <span class="inline-flex"> | |||
<tippy ref="language" interactive trigger="click" theme="popover" arrow> | <tippy ref="language" interactive trigger="click" theme="popover" arrow> | |||
<template #trigger> | <template #trigger> | |||
<span class="select-wrapper"> | <span class="select-wrapper"> | |||
<ButtonSecondary | <ButtonSecondary | |||
v-tippy="{ theme: 'tooltip' }" | v-tippy="{ theme: 'tooltip' }" | |||
:title="$t('settings.choose_language')" | :title="$t('settings.choose_language')" | |||
class="pr-8" | class="pr-8" | |||
outline | outline | |||
icon="language" | svg="globe" | |||
:label="`${ | :label="`${ | |||
$i18n.locales.find(({ code }) => code == $i18n.locale).name | $i18n.locales.find(({ code }) => code == $i18n.locale).name | |||
}`" | }`" | |||
/> | /> | |||
</span> | </span> | |||
</template> | </template> | |||
<NuxtLink | <NuxtLink | |||
v-for="(locale, index) in $i18n.locales.filter( | v-for="(locale, index) in $i18n.locales.filter( | |||
({ code }) => code !== $i18n.locale | ({ code }) => code !== $i18n.locale | |||
)" | )" | |||
:key="`locale-${index}`" | :key="`locale-${String(index)}`" | |||
:to="switchLocalePath(locale.code)" | :to="switchLocalePath(locale.code)" | |||
@click="$refs.language.tippy().hide()" | @click="$refs.language.tippy().hide()" | |||
> | > | |||
<SmartItem :label="locale.name" /> | <SmartItem :label="locale.name" /> | |||
</NuxtLink> | </NuxtLink> | |||
</tippy> | </tippy> | |||
</span> | </span> | |||
</template> | </template> | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |