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

vue-i18n-xlsx

v2.3.2

Published

基于webpack2.x,一个把 vue 项目中的翻译提取到 excel 以及输出到 js 文件的命令行工具

Downloads

3

Readme

vue-i18n-xlsx

简介

基于webpack2.x,一个把 vue 项目中的翻译提取到 excel 以及输出到 js 文件的命令行工具

特点

  1. 将整个项目的$t(xxx)或者Vue.t(yyy)的所有内容提取出来,然后将内容按照文本长度顺序导入进excel里面
  2. 将excel的翻译导入进项目的指定目录里面,按照vue-i18n的翻译格式生成js文件
  3. 可以将除了该分支下的别的分支的翻译一并合在一起

用法

  1. i18n-xlsx -p, --path [value] 指定要收集翻译的项目路径
  2. i18n-xlsx -b, --branch [value] 指定哪些分支可以收集翻译
  3. i18n-xlsx -i, --ignore-branch [value] 忽略哪些分支,不收集翻译
  4. i18n-xlsx -c, --current-branch 只收集当前分支的翻译
  5. i18n-xlsx -a, --all-branch 收集所有分支的翻译

结果

Excel文件

| index | zh | en | gb | | ----- | -- | -- | -- | | 中国 | 中国 | China | 中國 | | 你好 | 你好 | Hello | 你好 | | ... | ... | ... | ... |

js文件

/**
 *  Generate by vue-i18n-xlsx
 *  Do not modify this file manually
 */
export const zh = {...}
export const en = {...}
export const gb = {...}

.eslintignore

[path]/[filename].js

其他配置

也可以将path配置在项目的config/index.js中,只要加上以下配置即可

export default {
  ...,
  i18n: {
    entry1: {
      entry: 'src/entries/entry1',
      input: 'src/i18n/entry1.xlsx',
      output: 'src/i18n/entry1/index.js'
    },
    entry2: {
      entry: 'src/entries/entry2',
      input: 'src/i18n/entry2.xlsx',
      output: 'src/i18n/entry2/index.js'
    }
  }
}