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

@@ -35,8 +35,15 @@
<script setup lang="ts">
import useClient from '../../composables/useClient';
import useLocale from '~/composables/useLocale';
const { client } = useClient();
const runes = (await client.perks.listAsync({locale: "default", version: "latest"}))
.sort((a, b) => a.id - b.id);
const { currentLocale } = useLocale();
const getRunes = async () => (await client.perks.listAsync({locale: currentLocale.value, version: "latest"}))
.sort((a, b) => a.id - b.id)
const runes = ref(await getRunes());
watch(currentLocale, async() => {
runes.value = await getRunes();
});
</script>