Add locale handling

This commit is contained in:
2023-01-15 21:24:40 +01:00
parent 56d58a7ea2
commit c01f243fcd
8 changed files with 202 additions and 5 deletions

View File

@ -2,13 +2,19 @@
<Navbar />
<main>
<h1 class="text-5xl font-bold">
Hello world
</h1>
<div class="container mx-auto">
<h1 class="text-5xl font-bold">
{{ t("hello") }}
</h1>
</div>
</main>
</template>
<script setup lang="ts">
import Navbar from "@/components/Navbar/Navbar.vue";
import { useI18n } from "vue-i18n";
import locale from "./locale.json";
const { t } = useI18n({ messages: locale });
</script>

8
src/views/locale.json Normal file
View File

@ -0,0 +1,8 @@
{
"en": {
"hello": "Hello"
},
"it": {
"hello": "Ciao"
}
}