GitHub - Makio64/vue-tiny-translation (original) (raw)

Vue Tiny Translation 🌍✨

A minimalist reactive translation plugin for Vue 3. Super lightweight (0.32KB gzipped), simple, and efficient internationalization solution.

🌐 Live Demo - Try it now ![Screenshot 2025-05-24 at 18 40 31](https://private-user-images.githubusercontent.com/213351/447273600-deae1302-a9c7-48d0-a63f-5bce37b83cd8.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjU5ODQwMDIsIm5iZiI6MTc2NTk4MzcwMiwicGF0aCI6Ii8yMTMzNTEvNDQ3MjczNjAwLWRlYWUxMzAyLWE5YzctNDhkMC1hNjNmLTViY2UzN2I4M2NkOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUxMjE3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MTIxN1QxNTAxNDJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jZDY1Y2Q3YWRmZGVjMTc0NjU2OTY4OTEyZWY1MGJiNjQ2NzFmYzAzMTEzNTBlMTM2N2Q4MTgwODQyYjlkY2EzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.cGrtyp81eeEAzXqGJuqaRHG9vwb89pSX61Q0dPyqRf8)

Features

Installation

npm install vue-tiny-translation

Quick Start

1. Install the plugin

import { createApp } from 'vue' import TinyTranslation from 'vue-tiny-translation' import App from './App.vue'

const app = createApp(App) app.use(TinyTranslation) app.mount('#app')

2. Load translations and use in components

{{ $t('hello') }}

{{ $t('goodbye') }}

Change Language

Load translation files from anywhere

// Load from anywhere await loadTranslations('/translations/en.json') // Local files await loadTranslations('/api/translations/en') // API endpoints

Example of organization using local files

public/translations/ 
  en.json
  fr.json
  de.json

{ "hello": "Hello", "goodbye": "Goodbye" }

API

Demo & Testing

🌐 Live Demo - Try it now !

Local Testing: Clone and run the example locally:

cd example npm install npm run dev

Open http://localhost:5173 and see the plugin working with automatic language detection!

License

MIT © Makio64