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

i18n-abc

v0.5.0

Published

## 功能 1. 自动提取待翻译的 key/value,生成缩短过后的 key(用 CRC16) 2. 删除未翻译的多语言文本 3. 未翻译的多语言文本用默认语言代替 4. 自动进行简单的简繁转换

Downloads

86

Readme

Auto extract translation keys/values from your code, and generate shortened key.

功能

  1. 自动提取待翻译的 key/value,生成缩短过后的 key(用 CRC16)
  2. 删除未翻译的多语言文本
  3. 未翻译的多语言文本用默认语言代替
  4. 自动进行简单的简繁转换

安装

npm install i18n-abc

使用

在项目根目录下创建 i18n-abc.config.js 文件:

module.exports = {
  scan: {
    input: [
      './src/**/*.{js,ts,vue}',
      '!./src/static/**',
    ],
    output: './src/locales/raw',
  },
  transform: {
    input: './src/locales/raw',
    output: './src/locales',
  }
}

更多配置项,请参考 i18n-abc.config.js

扫描

开始扫描并生成 i18n 文件:

i18n-abc scan

处理

处理 i18n 文件,比如简体中文转繁体中文,清理没有翻译的文本。

i18n-abc transform

提取未翻译文本

提取未翻译的文本,并生成对应语言的 csv 文件。

i18n-abc diff

翻译

将已翻译好的 excel 文件应用到 json 文件中。 注意:excel 文件名需和语言代码对应,表格第一列为待翻译文本,第二列为翻译好的文本。

i18n-abc translate

todo

  1. 增加一个 root path,所有配置都相对于该 root path
{
  "root": "./web/",
  "scan": {}
}