# simplify-vue-i18n

> simplify-vue-i18n

Latest version **0.0.1** (published 2022-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install simplify-vue-i18n
pnpm add simplify-vue-i18n
yarn add simplify-vue-i18n
bun add simplify-vue-i18n
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2022-10-17 |
| First published | 2022-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Simon He |
| Maintainers | simon_he |
| Keywords | simplify-vue-i18n, vue |

## Links

- npm: https://www.npmjs.com/package/simplify-vue-i18n
- Repository: https://github.com/Simon-He95/simplify-vue-i18n
- Homepage: https://github.com/Simon-He95/simplify-vue-i18n#readme
- Issues: https://github.com/Simon-He95/simplify-vue-i18n/issues
- npm.io page: https://npm.io/package/simplify-vue-i18n

## Dependencies (3)

- [vue](https://npm.io/package/vue.md) ^3.2.36
- [vue-i18n](https://npm.io/package/vue-i18n.md) 9
- [@vueuse/core](https://npm.io/package/@vueuse/core.md) ^8.1.1

## 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

- 0.0.1 (latest) — 2022-10-17

## README

<span><div align="center">![kv](/assets/kv.png)</div></span>
<p align="center"><a href="https://www.npmjs.com/package/simplify-vue-i18n">simplify-vue-i18n</a></p>
To make it easier for you to use vue-i18n

## Installation
```bash
npm install simplify-vue-i18n
```

## Usage
```js
import { useLocale } from 'simplify-vue-i18n'
const messages = {
  zh: {
    message: {
      hello: '你好，世界'
    }
  },
  en: {
    message: {
      hello: 'hello world',
    },
  },
  jp: {
    message: {
      hello: 'こんにちは、世界',
    },
  },
}
const i18n = useLocale(messages)
const app = createApp(App)
app.use(i18n)
```
```html
<!-- switch language -->
import { changeLocale } from "simplify-vue-i18n";

<template>
  <p>{{ $t("message.hello") }}</p>
  <div flex="~ gap3" justify-center my4>
    <button @click="changeLocale('zh')" btn>zh</button>
    <button @click="changeLocale('jp')" btn>jp</button>
    <button @click="changeLocale('en')" btn>en</button>
  </div>
</template>
```

```html
<!-- scoped message -->
import { useScopeLocale } from "simplify-vue-i18n";
useScopeLocale({
  locale:'zh',
  message:{
    ...
  }
})

<template>
  <p>{{ $t("message.hello") }}</p>
  <div flex="~ gap3" justify-center my4>
    <button @click="changeLocale('zh')" btn>zh</button>
    <button @click="changeLocale('jp')" btn>jp</button>
    <button @click="changeLocale('en')" btn>en</button>
  </div>
</template>
```

## Thanks
- [vue-i18n-next](https://github.com/intlify/vue-i18n-next)
- [vue](https://github.com/vuejs/core)

<a href="https://github.com/Simon-He95/sponsor" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" ></a>

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