vue-mini-translate

1.1.0 • Public • Published

vue-mini-translate

A copy of i18n but very, very, very slim and blazingly fast. If you need a simple translation tool and i18n is too big, use vue-mini-translate!

Usage

It is very simple to use this package. Follow these steps:

  1. Install it with the command-line:
npm install vue-mini-translate
  1. Add the plugin to your app:
import Vue from 'vue'
import VMT from 'vue-mini-translate'
 
Vue.use(VMT)
  1. Add a language with translations:
import enObject from '../locales/en.json' // { test: 'test-text', key567: 'value749' [...] }
 
// small amount of language
this.$mt.addLanguage('de', { 
    test: 'test-text' 
})
// bulk import
this.$mt.addLanguage('en', { ...enObject })
 
  1. Set a language (default is 'de')
this.$mt.setLanguage('en')
  1. Get the value
<template>
    <div class="translation">{{$t('test')}}</div> 
    <!-- output: test-text -->
</template>
  1. That's it. This plugin can't do anything else.

Development

Feel free to fork this project and/or contribute to this repository. This codebase will be improved, but no more Features will be active added.

Readme

Keywords

none

Package Sidebar

Install

npm i vue-mini-translate

Weekly Downloads

3

Version

1.1.0

License

none

Unpacked Size

10.4 kB

Total Files

14

Last publish

Collaborators

  • maximilli