# @mandk/i18n-help

> 这是一个小工具且不完善，减轻手动修改的工作量。 用命令行将文件中的中文转换为$t('中文')的vue-i18n写法，并生输出被转换词的json到终端。

Latest version **0.1.1** (published 2022-11-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mandk/i18n-help
pnpm add @mandk/i18n-help
yarn add @mandk/i18n-help
bun add @mandk/i18n-help
```

Provides the command `mandk`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2022-11-04 |
| First published | 2022-11-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 17.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | xuxiao |
| Maintainers | mandk |
| Keywords | node, javascript, i18n, js, i18nTT |

## Links

- npm: https://www.npmjs.com/package/@mandk/i18n-help
- Repository: https://github.com/Markxuxiao/i18nTT
- Homepage: https://github.com/Markxuxiao/i18nTT#readme
- Issues: https://github.com/Markxuxiao/i18nTT/issues
- npm.io page: https://npm.io/package/@mandk/i18n-help

## Dependencies (1)

- [commander](https://npm.io/package/commander.md) ^9.4.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.1.1 (latest) — 2022-11-04
- 0.1.0 — 2022-11-04
- 0.0.1 — 2022-11-03

## README

# 作用
这是一个小工具且不完善，减轻手动修改的工作量。
用命令行将文件中的中文转换为$t('中文')的vue-i18n写法，并生输出被转换词的json到终端。

##转换目标

template
- [x] 中文 -> {{$t('中文')}}
- [x] lable = "中文" -> :lable = "$t('中文')"
- [ ] lable = '中文' -> :lable = "$t('中文')"
- [ ] 跳过单行注释
- [ ] 跳过多行注释


script
- [x] '中文' -> this.$t('中文')
- [x] "中文" -> this.$t('中文')
- [ ] 跳过单行注释
- [ ] 跳过多行注释

# 安装
npm i @mandk/i18n-help -g
# 使用
 ## translate命令
 项目下面执行
 mandk translate src/app/views/xxx.vue
文件路径可以从vscode中复制相对路径
终端会打印替换过的词json，方便复制到语言文件中使用

# 本地开发优化此工具
* 下载项目包
* npm i
* npm run test
* 修改文件功能，编写新的测试用例

# 测试工具文档
[mochajs](https://mochajs.org/#getting-started)

# 发布
npm publish --access public

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