{{ t(\"hello\") }}
\n\n```\n\n**Key:** vue-i18n for translations."}}]}vue-i18n — internationalization.
Setup:
1import { createI18n } from "vue-i18n"23const i18n = createI18n({4 locale: "en",5 messages: {6 en: { hello: "Hello" },7 ru: { hello: "Привет" }8 }9})
Usage:
1<script setup>2import { useI18n } from "vue-i18n"34const { t, locale } = useI18n()5locale.value = "ru"6</script>78<template>9 <p>{{ t("hello") }}</p>10</template>
Key: vue-i18n for translations.