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 🙏

© 2024 – Pkg Stats / Ryan Hefner

wy-kiwi-clis

v0.0.4

Published

a cli for kiwi

Downloads

3

Readme

🐤 kiwi cli

Kiwi 的 CLI 工具

如何使用

yarn global add wy-kiwi-clis

推荐与🐤 Kiwi-国际化全流程解决方案结合使用

强行修改了整体内容,使其支持jsx,但是需要把jsx 重命名为ts , 然后每次执行 命令前,需要将kiwi目录下的文件tsc 一波

tsc .kiwi/*/*.ts

修改了 extract 相关内容,去掉翻译相关的内容,直接使用uuid当做key 修改了 translate 相关内容 出现报错时 允许继续下去

CLI 参数

kiwi --init

初始化项目,生成 kiwi 的配置文件 kiwi-config.json

{
  // kiwi文件根目录,用于放置提取的langs文件
  "kiwiDir": "./.kiwi",

  // 配置文件目录,若调整配置文件,此处可手动修改
  "configFile": "./.kiwi/kiwi-config.json",

  // 语言目录名,注意连线和下划线
  "srcLang": "zh-CN",
  "distLangs": ["en-US", "zh-TW"],

  // googleApiKey
  "googleApiKey": "",

  // baiduApiKey
  "baiduApiKey":
    "appId": '',
    "appKey": ''
  },

  // 百度翻译的语种代码映射 详情见官方文档 https://fanyi-api.baidu.com/doc/21
  "baiduLangMap": {
    "en-US": 'en',
    "zh-TW": 'cht'
  },

  // import 语句,不同项目请自己配置
  "importI18N": "",

  // 可跳过的文件夹名或者文加名,比如docs、mock等
  "ignoreDir": "",
  "ignoreFile": ""
}

kiwi --extract

一键批量替换指定文件夹下的所有文案

kiwi --extract [dirPath]

批量替换

kiwi --import

导入翻译文案,将翻译人员翻译的文案,导入到项目中

# 导入送翻后的文案
kiwi --import [filePath] en-US

kiwi --export

导出未翻译的文案

# 导出指定语言的文案,lang取值为配置中distLangs值,如en-US导出还未翻译成英文的中文文案
kiwi --export [filePath] en-US

kiwi --sync

同步各种语言的文案,同步未翻译文件

kiwi --mock

使用 Google 翻译,翻译未翻译的文案 如果同时配置baiduApiKey与baiduApiKey 则命令行可手动选择翻译源

kiwi --translate

全量翻译未翻译的中文文案,翻译结果自动导入 en-US zh-TW等目录

kiwi --translate