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-tool

v1.0.0

Published

vue 多语言自动生成工具

Downloads

6

Readme

vue-i18n-tool

vue 多语言自动生成工具

轻松对 Vue 组件进行国际化处理,自动生成多语言配置文件,并通过百度翻译进行自动翻译

DEMO

cd ./sample
node ./scripts/i18n.js

生成格式

处理前

<template>
  <div class="hello">
    <h3>基本</h3>
    <ul>
      <li><a href="https://vuejs.org" target="_blank" rel="noopener">核心文件</a></li>
      <li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">论坛</a></li>
      <li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">社区聊天</a></li>
      <li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
      <li><a href="https://news.vuejs.org" target="_blank" rel="noopener">新闻</a></li>
    </ul>
  </div>
</template>

处理后

<template>
  <div class="hello">
    <h3>{{$t('components__HelloWorld.4092ed')}}</h3>
    <ul>
      <li><a href="https://vuejs.org" target="_blank" rel="noopener">{{$t('components__HelloWorld.c86fba')}}</a></li>
      <li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">{{$t('components__HelloWorld.a5f625')}}</a></li>
      <li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">{{$t('components__HelloWorld.6f459b')}}</a></li>
      <li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
      <li><a href="https://news.vuejs.org" target="_blank" rel="noopener">{{$t('components__HelloWorld.1d9c15')}}</a></li>
    </ul>
  </div>
</template>

en.json

{
	"components__HelloWorld": {
		"170227": "ecosystem",
		"45c32e": "For guidance and methods on how to configure / customize this project,",
		"7e4042": "Please check",
		"9a9a08": "Vue cli document",
		"e4bb40": "Installed cli plug ins",
		"4092ed": "basic",
		"c86fba": "Core document",
		"a5f625": "forum",
		"6f459b": "Community chat",
		"1d9c15": "Journalism"
	}
}

zh.json

{
	"components__HelloWorld": {
		"170227": "生态系统",
		"45c32e": "有关如何配置/自定义此项目的指南和方法,",
		"7e4042": "请查看",
		"9a9a08": "vue-cli 文档",
		"e4bb40": "已安装的CLI插件",
		"4092ed": "基本",
		"c86fba": "核心文件",
		"a5f625": "论坛",
		"6f459b": "社区聊天",
		"1d9c15": "新闻"
	}
}

settings.json

{
	"components__HelloWorld": [
		{
			"key": "170227",
			"content": "生态系统",
			"baidu_en": "ecosystem"
		},
		{
			"key": "45c32e",
			"content": "有关如何配置/自定义此项目的指南和方法,",
			"baidu_en": "For guidance and methods on how to configure / customize this project,"
		},
		{
			"key": "7e4042",
			"content": "请查看",
			"baidu_en": "Please check"
		},
		{
			"key": "9a9a08",
			"content": "vue-cli 文档",
			"baidu_en": "Vue cli document"
		},
		{
			"key": "e4bb40",
			"content": "已安装的CLI插件",
			"baidu_en": "Installed cli plug ins"
		},
		{
			"key": "4092ed",
			"content": "基本",
			"baidu_en": "basic"
		},
		{
			"key": "c86fba",
			"content": "核心文件",
			"baidu_en": "Core document"
		},
		{
			"key": "a5f625",
			"content": "论坛",
			"baidu_en": "forum"
		},
		{
			"key": "6f459b",
			"content": "社区聊天",
			"baidu_en": "Community chat"
		},
		{
			"key": "1d9c15",
			"content": "新闻",
			"baidu_en": "Journalism"
		}
	]
}