mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-23 08:16:16 -04:00
29 lines
537 B
Vue
29 lines
537 B
Vue
![]() |
<script setup lang="ts">
|
||
|
const { availableLocales, locale } = useI18n();
|
||
|
|
||
|
const localesLong: Record<string, string> = {
|
||
|
en: 'English',
|
||
|
es: 'Español',
|
||
|
fr: 'Français',
|
||
|
pt: 'Português',
|
||
|
ru: 'Русский',
|
||
|
zh: '中文',
|
||
|
};
|
||
|
|
||
|
const localeOptions = computed(() =>
|
||
|
availableLocales.map(locale => ({
|
||
|
label: localesLong[locale] ?? locale,
|
||
|
value: locale,
|
||
|
})),
|
||
|
);
|
||
|
</script>
|
||
|
|
||
|
<template>
|
||
|
<c-select
|
||
|
v-model:value="locale"
|
||
|
:options="localeOptions"
|
||
|
placeholder="Select a language"
|
||
|
w-100px
|
||
|
/>
|
||
|
</template>
|