npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

i18n-super-cli

v1.0.1

Published

A custom i18n CLI tool for Vue projects

Readme

i18n-super-cli

专为VUE项目定制的国际化(i18n)CLI 工具,支持自动提取中文词条、Excel 互转、以及调用百度翻译 API 进行自动翻译。

安装

npm install i18n-super-cli --save-dev
# 或者全局安装
npm install -g i18n-super-cli

快速开始

  1. 在项目根目录创建配置文件 i18n.config.js
module.exports = {
  // 源码根目录
  rootDir: "src",
  
  // 中文包裹配置
  zhWrap: {
    // 扫描 src 下的文件
    rootDir: "src", 
    // 只处理 .vue 文件
    i18nFileRules: ["**/*.vue"],
    // Vue 文件中使用的国际化方法名
    vueI18nFuncName: "$t",
  },

  // 提取配置
  extract: {
    // 扫描哪些文件
    include: ["**/*.vue"],
    exclude: ["**/node_modules/**/*"],
    // 导出目录 (默认会自动根据 rootDir 生成)
    // outputZh: "src/lang/modules/zh-CN",
    // outputEn: "src/lang/modules/en"
  },

  // 翻译配置
  translate: {
    // 百度翻译 App ID
    baiduAppId: "你的APP_ID", 
    // 百度翻译 Key
    baiduKey: "你的密钥", 
  }
};
  1. package.json 中添加脚本:
"scripts": {
  "i18n:wrap": "i18n-super wrap",
  "i18n:extract": "i18n-super extract",
  "i18n:translate": "i18n-super translate",
  "i18n:fill": "i18n-super fill"
}

命令说明

1. 自动包裹中文 (wrap)

自动扫描源码中的中文文本,并使用 $t(...) 进行包裹。此功能基于 vve-i18n-zh-wrap-cli 实现。

i18n-super wrap

2. 提取词条 (extract)

扫描指定文件中的中文词条(通过 $t('...') 识别),并生成 JSON 文件。 如果发现未翻译的词条,会在根目录生成 未翻译词条.xlsx完整词条.xlsx

i18n-super extract

3. 自动翻译 (translate)

读取配置中的百度翻译 API Key,自动翻译英文 JSON 文件中尚未翻译的词条。

i18n-super translate

4. 回填翻译 (fill)

读取根目录下的 resource.xlsx(通常由人工翻译后提供),将翻译结果回填到 JSON 文件中。

i18n-super fill

配置项详解

配置文件名:

  • i18n.config.js

完整配置示例请参考包内的 i18n.config.example.js