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

eti18n

v1.4.1

Published

Internationalized excel documents into js files

Downloads

2

Readme

eti18n

多语言excel文件转换js代码命令行

Internationalized excel documents into js files

安装

基于node,请确保已具备较新的node环境(>=8.9.0),推荐使用node版本管理工具nvm,这样不仅可以很方便地切换node版本,而且全局安装时候也不用加sudo了。

安装本项目 eti18n

$ [sudo] npm install -g eti18n

由于国外源实在太慢,建议使用国内源来安装

$ [sudo] npm i -g eti18n --registry=https://registry.npm.taobao.org

快速开始

在文件名为i18n多语言excel文件同级目录下运行以下命令

$ eti18n

查看命令的参数运行以下命令

$ eti18n -h

参数 -f 或 --file 指定excel文件

参数-c 或 --config 指定转换配置文件

参数 -p 或 --path 指定生成路径

参数 -e 或 --excel 根据zh-cn.js文件生成excel模板

在项目可以配置npm scripts使用自定义脚本

{
  "scripts": {
    "i18n": eti18n -f src/lang/**.xlsx -c src/lang/config -p src/lang/
  }
}

在项目根目录运行以下命令

$ npm run i18n

配置文件说明

  1. 生成语言多对应js文件名
{
  "fileName": {
    "中文": "zh-cn",
    "英文": "en",
    "繁体中文(香港)": "zh-hk"
  }
}
  1. 匹配替换设置
{
  "regex": {
    "day": {
      "key": "{{x}}",
      "result": "{day}"
    },
    "text": {
      "key": "{{}}",
      "type": "include",
      "result": ["<div class='text-all'>","</div>"]
    },
    "text1": {
      "key": "{{}}",
      "result": ["<h1 class='text-1'>","</h1>"]
    },
    "text2": {
      "key": "{{}}",
      "type": "include",
      "result": ["<p class='text-2'>","</p>"]
    }
  }
}

许可

MIT