# vue-translations

> Translataion for your VueJS2 application. (like as laravel translations)

Latest version **1.0.0** (published 2018-06-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-translations
pnpm add vue-translations
yarn add vue-translations
bun add vue-translations
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-06-10 |
| First published | 2017-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 26 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Markin Maxim |
| Maintainers | barracoota |
| Keywords | vue, vuejs, translations, multilang, i18n, vuejs2 |

## Links

- npm: https://www.npmjs.com/package/vue-translations
- Repository: https://github.com/owl1n/vue-translations
- Homepage: https://github.com/owl1n/vue-translations#readme
- Issues: https://github.com/owl1n/vue-translations/issues
- npm.io page: https://npm.io/package/vue-translations

## Alternatives

- [messageformat](https://npm.io/package/messageformat.md) — 329.7K weekly downloads
- [@mintlify/scraping](https://npm.io/package/@mintlify/scraping.md) — 294.8K weekly downloads
- [@mintlify/previewing](https://npm.io/package/@mintlify/previewing.md) — 209.5K weekly downloads
- [@mintlify/prebuild](https://npm.io/package/@mintlify/prebuild.md) — 209.5K weekly downloads
- [@mintlify/link-rot](https://npm.io/package/@mintlify/link-rot.md) — 206.3K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-06-10
- 0.1.5 — 2018-06-10
- 0.1.4 — 2018-06-10
- 0.1.3 — 2018-06-10
- 0.1.2 — 2017-09-25
- 0.1.1 — 2017-09-25
- 0.1.0 — 2017-09-25

## README

## VueJs Translations :shipit:

Hello everybody! I'm glad to present you a library to support the translations in your Vue project.

This translations component is very similar to Laravel Translations. You can setup inline params in your locale if needed.

Installation is very simple, in a few steps:

```shell
npm i vue-translations
```

You need to setup locale file for yourself.
```javascript
// locales.js
export default {
    en: {
        home: {
            header: 'My best project ever',
        },
    },
    ru: {
        home: {
            header: 'Мой лучший проект в жизни',
        },
    },
};
```

```javascript
import VueTranslation from 'vue-translations'
import locales from './locales.js';

Vue.use(VueTranslations);

new Vue({
    mounted() {
        // setup from one method
        this.$translations.setup('en', locales);
        // another methods:
        // change current language
        this.$translations.setLang('en');
        // load locales
        this.$translations.load(locales);
    },
    render: (h) => h,
});
```

Use it in your projects is easy!
```javascript
<template>
    <div v-text="__t('home.header')" />
</template>
```

### Inline params

Into your locale file
```javascript
en: {
        home: {
            header: 'My best project - :name',
        },
    },
},
```

Into your application
```javascript
<div v-text="__t('home.header', { name: 'Project' })" />
// output: My best project - Project
```

---
_Source: https://npm.io/package/vue-translations · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
