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

ggi18n

v0.0.26

Published

google translate

Downloads

61

Readme

ggi18n

一个基于Google翻译的多语言翻译工具,可以帮助你快速实现项目的国际化。

版本查询

使用 -v 参数可以查看当前工具版本:

ggi18n -v

特性

  • 🚀 支持批量翻译JSON语言包
  • 🔄 支持基于已有语言包快速创建新语种
  • 📝 支持单个翻译文本的快速更新
  • 🎯 支持多层级JSON结构的翻译
  • 🗑️ 支持一键删除所有字典的指定翻译文本
  • 🌐 支持所有Google翻译支持的语种

安装使用

npm install -g ggi18n
# 或者
yarn add -g ggi18n
# 或者
pnpm add -g ggi18n
# 或者 (推荐)
npx ggi18n ...

使用方法

1. 翻译文案

将已有的语言包翻译成新的语种:

npx ggi18n --path=src/lang --word=hello

参数说明:

  • --path: 语言包所在目录
  • --word=hello: 指定是文案翻译,hello为翻译的文案,未制定key=value的value时,hello即为key也为value
  • --word=a.b.c=hello: 多层级翻译支持,如果指定了多层级需要有对应的value值

2. 删除文案

将已有的语言包翻译成新的语种:

npx ggi18n --path=src/lang --delete=main

参数说明:

  • --path: 语言包所在目录
  • --delete=main: 指定key为main的文案删除
  • --delete=main.left: 指定key为main.left的多层级文案删除

3. 创建新语种

基于已有语种快速创建新的语言包:

npx ggi18n --path=src/lang --new=en:ja

参数说明:

  • --new: 指定源语种和目标语种,格式为源语种:目标语种

支持的语言代码

支持所有Google翻译支持的语种,常用语种代码示例:

| 语言 | 代码 | |------|------| | 简体中文 | zh-CN | | 繁体中文 | zh-TW | | 英语 | en | | 日语 | ja | | 韩语 | ko |

更多语种请移步 Google翻译 选择对应的目标语言在URL地址栏查看获取

注意事项

  1. 确保项目目录下有正确的语言包目录JSON结构
  2. 翻译前请确保源语言文件格式正确
  3. 建议先使用小型文件测试翻译效果
  4. 翻译结果会自动保存到目标语言文件中

许可证

ISC License