@aivue/translate
v1.0.1
Published
AI translation widget for Vue — detect language, translate, and copy results
Maintainers
Readme
@aivue/translate
AI translation widget for Vue 2 and Vue 3.
Features
- Detect the source language, or set it yourself
- Translate into a target language
- Switch formality when the language supports it
AiTranslatefor the widget, and the same@aivue/coreclient as the other packages
Install
npm install @aivue/translate @aivue/core vueUsage
<script setup>
import { ref } from 'vue';
import { AIClient } from '@aivue/core';
import { AiTranslate } from '@aivue/translate';
import '@aivue/translate/style.css';
const client = new AIClient({ provider: 'openai', apiKey: import.meta.env.VITE_OPENAI_API_KEY });
const text = ref('');
</script>
<template>
<AiTranslate v-model="text" :client="client" source-lang="auto" target-lang="es" />
</template>