mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-23 00:06:15 -04:00
32 lines
627 B
Vue
32 lines
627 B
Vue
<script setup lang="ts">
|
|
const { availableLocales, locale } = useI18n();
|
|
|
|
const localesLong: Record<string, string> = {
|
|
en: 'English',
|
|
de: 'Deutsch',
|
|
es: 'Español',
|
|
fr: 'Français',
|
|
no: 'Norwegian',
|
|
pt: 'Português',
|
|
ru: 'Русский',
|
|
uk: 'Українська',
|
|
zh: '中文',
|
|
vi: 'Tiếng Việt',
|
|
};
|
|
|
|
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>
|