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

v1.0.3

Published

语言包自动翻译

Downloads

11

Readme

自动翻译语言包文件

以中文语言文件为源, 翻译出其他语言文件

配置文件 config.js

 entry:{
        inPath: 'E:\\git_tools\\translate\\test\\lang', // 读取源文件
        outPath:'E:\\git_tools\\translate\\test\\lang'  // 输出目录
    },
    baiduTranslate:{
        key:'xxxxxxxxxxxx',
        appid:'xxxxxxxxxxxxxxx',
        url:'http://api.fanyi.baidu.com/api/trans/vip/translate',
        delay: 1100, // 延迟
        batchCount : 9, // dps (百度翻译开放平台普通版 dps 为 10/s , 故这里设为9)
    }

调用方法

var Lang = require('i18n-zh2other/dist/lang').default
const config = {
  entry: {
    inPath: 'E:\\git\\devops\\devops-web\\static\\lang', // 读取源文件
    outPath: 'E:\\git\\devops\\devops-web\\static\\lang' // 输出目录
  },
  baiduTranslate: {
    key: 'xxxxxxxxxxxxxxx',
    appid: 'xxxxxxxxxxxxxxx',
    url: 'http://api.fanyi.baidu.com/api/trans/vip/translate',
    delay: 1100,
    batchCount: 9
  }
}
new Lang(config).startExecuteTranslate('en')

中文语言文件

{
	"70fe2d2f982764266e2d8c341afbaf64": "不能输入特殊字符!",
	"a26a8652f42f3cef86c4023c41d7550a": "不符合用户名规则!",
	"54d217d31d5ee2a1e820a171a2638d5e": "不符合Url规范!",
	"d8fa7a280781f63ff17c1bd83b17619b": "不符合IP规范!",
	"f7327186ec9f21ca0a90588360dab67a": "不能为空!",
	"e5cbc7f2d34c615ca54e8493d7e29182": "数字!",
	"0de252a30568f591a4e932b1438656be": "手机号格式错误!",
	"c4bec36c3a85aba479f369864ba059a8": "含汉字,字母、数字、-,_",
	"c0b31fa6706439674e3d58901d7d3ad6": "含字母、数字、-,_",
	"626cd8c7c3294513e735b27c6baa77b8": "含字母、数字、-,_,.",
	"f27ae89fa644c0074630c6a8fc9ead19": "邮编格式不正确"
}

翻译后英文语言文件

{
  "70fe2d2f982764266e2d8c341afbaf64": "Special characters cannot be input!",
  "a26a8652f42f3cef86c4023c41d7550a": "Does not conform to the user name rule!",
  "54d217d31d5ee2a1e820a171a2638d5e": "Does not conform to the URL specification!",
  "d8fa7a280781f63ff17c1bd83b17619b": "Does not conform to IP specification!",
  "f7327186ec9f21ca0a90588360dab67a": "Cannot be empty!",
  "e5cbc7f2d34c615ca54e8493d7e29182": "Numbers!",
  "0de252a30568f591a4e932b1438656be": "Wrong format of mobile phone number!",
  "c4bec36c3a85aba479f369864ba059a8": "Including Chinese characters, letters, numbers and -_",
  "c0b31fa6706439674e3d58901d7d3ad6": "Including letters, numbers and -_",
  "626cd8c7c3294513e735b27c6baa77b8": "Including letters, numbers and -_ ,.",
  "f27ae89fa644c0074630c6a8fc9ead19": "Incorrect zip code format"
}