# vue-quick-i18n

> quick i18n plugin for vue developer

Latest version **0.4.9** (published 2023-07-19) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.9 |
| Published | 2023-07-19 |
| First published | 2023-02-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^16 |
| Dependencies | 9 |
| Unpacked size | 88.6 MB |
| Known vulnerabilities | 0 (+10 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | jamesezhang |
| Keywords | vue, vue i18n, vue-i18n, fast i18n, i18n tool, i18n, developer-tool |

## Links

- npm: https://www.npmjs.com/package/vue-quick-i18n
- Repository: https://github.com/GolderBrother/vue-quick-i18n
- Homepage: https://github.com/GolderBrother/vue-quick-i18n/blob/master/README.md
- Issues: https://github.com/GolderBrother/vue-quick-i18n/issues
- npm.io page: https://npm.io/package/vue-quick-i18n

## Dependencies (9)

- [flat](https://npm.io/package/flat.md) ^4.1.0
- [puid](https://npm.io/package/puid.md) ^1.0.7
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [safe-eval](https://npm.io/package/safe-eval.md) ^0.4.1
- [sort-json](https://npm.io/package/sort-json.md) ^2.0.0
- [unflatten](https://npm.io/package/unflatten.md) ^1.0.4
- [validator](https://npm.io/package/validator.md) ^12.1.0
- [json-to-ast](https://npm.io/package/json-to-ast.md) ^2.1.0
- [sort-package-json](https://npm.io/package/sort-package-json.md) ^1.40.0

## 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.4.9 (latest) — 2023-07-19
- 0.4.8 — 2023-07-19
- 0.4.7 — 2023-07-19
- 0.4.5 — 2023-02-02

## README

# Vue i18n

<!-- [![](https://vsmarketplacebadge.apphb.com/version/GolderBrother.vue-quick-i18n.svg)](https://marketplace.visualstudio.com/items?itemName=GolderBrother.vue-quick-i18n)
[![](https://vsmarketplacebadge.apphb.com/installs-short/GolderBrother.vue-quick-i18n.svg)](https://marketplace.visualstudio.com/items?itemName=GolderBrother.vue-quick-i18n)
[![](https://vsmarketplacebadge.apphb.com/downloads-short/GolderBrother.vue-quick-i18n.svg)](https://marketplace.visualstudio.com/items?itemName=GolderBrother.vue-quick-i18n)
[![](https://vsmarketplacebadge.apphb.com/rating-short/GolderBrother.vue-quick-i18n.svg)](https://marketplace.visualstudio.com/items?itemName=GolderBrother.vue-quick-i18n)
[![](https://vsmarketplacebadge.apphb.com/trending-monthly/GolderBrother.vue-quick-i18n.svg)](https://marketplace.visualstudio.com/items?itemName=GolderBrother.vue-quick-i18n) -->


## ✨ 快速开始
![vue-quick-i18n](vue-quick-i18n.gif)

## 例子

现有项目国际化非常的繁琐:

1. 将所有出现的要国际化的汉字复制取名配置
1. 在 vue/js 文件中找到汉字位置，区分是在`template`中标签的`label`或者其他`property`中，或者`{{}}`中`script`，又或者`script`中的，手动将一层一层的国际化 key 拷贝，粘贴。
1. 就算是相同的汉子，由于在 vue 中的语法不同，需要重复的拷贝，粘贴
1. 碰到一堆汉字拼接的简直要了老命/(ㄒ o ㄒ)/~~

## 设计

![feature](feature.png)

## 插件功能

1. 检测 vue/js 中的需要国际化的汉字，自动生成 json 文件
1. 根据 json 文件检测 vue/js,检测汉字，自动替换成步骤 1 生成的 json 的 key
1. 检测 vue/js 文件中的已替换的 key，展示对应汉字提示弹窗
1. xxx.json 文件中，生成扁平化的 locales 的 xxx_flat.json 文件,方便取值复制
1. 在 vue/js 中提供，提供 t,tt,ttt 代码提示

## TODO

- [x] 国际化 json 文件名可配置
- [x] 悬浮展示 i18n value，跳转 json 文件
- [x] 通过项目配置文件获取配置 settings,其中项目配置文件优先级最高(richierc.json)
- [x] 增加 puidType 配置，默认使用`short`类型（12 位),提供`long`类型（24 位），生成唯一 key
- [x] 使用 JSON AST 代替 RegExp 优化跳转体验
- [ ] 增加 webview 展示替换更新等提醒界面
- [ ] 支持 JS I18n 文件写入与读取

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