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

@nnnb/nnnb18n

v1.0.1

Published

nnnb的umi国际化翻译工具

Downloads

5

Readme

nnnb-nnnb18n

umi国际化提取 觉得有帮助的话请给一个star支持一下

通过脚本把 指定文件下的所有 formatMessage方法转换为locales下的json对象
import { formatMessage } from 'umi/locale';
const a=formatMessage({
      id: 'user.login.tip',
      defaultMessage: '请登录',
  })
转换为
//zh-CN
export default {
  "user.login.tip": "请登录",
}
//zh-TW
export default {
  "user.login.tip": "請登入",
}
//en-US 由于需要对接云端的一些翻译api 需要配acces key 
export default {
  "user.login.tip": "Please login",
}

使用说明 会支持两种使用方式

区别在于 默认属性的支持度不一样 项目级可以配置json文件来做到一些文件过滤之类的属性 做到项目级统一规范 终端命令式 在于简单方便 能随时随地使用

1.在终端使用命令行 如 nnnb18n [-d <文件夹>]
1.使用命令行 如 nnnb18n [-d <文件夹>]
如果在项目中使用配置需要配置locales.config.js
const { defineLocalesConfig } = require('@nnnb/nnnb18n')
// 建议注册百度翻译api 自己配置自己的
module.exports = defineLocalesConfig({
  baiduAppId: "xxxxx",
  baiduKey: "xxxx",
})
敬请期待 todo

后续支持可配置式的函数名,理论支持所有的国际化翻译,还需要做 如

  const funcName='local'
  const params='id,name'
  // 则解析 方法为
  local("user.login.tip","请登录")