Add i18n support for data

This commit is contained in:
BlossomiShymae
2024-09-09 15:58:00 -05:00
parent b0491d569a
commit 90de82ba20
18 changed files with 210 additions and 41 deletions

View File

@@ -43,7 +43,14 @@
<script setup lang="ts">
import useClient from '../../composables/useClient';
import useLocale from '~/composables/useLocale';
const { client } = useClient();
const items = await client.items.listAsync({ locale: "default", version: "latest"});
const { currentLocale } = useLocale();
const getItems = async () => await client.items.listAsync({ locale: currentLocale.value, version: "latest"});
const items = ref(await getItems());
watch(currentLocale, async () => {
items.value = await getItems();
});
</script>