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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@beisen-cmps/i18n-resource-wrapper

v0.1.7

Published

1.引入多语言 wrapper ``` import I18NWrapper from '@beisen-cmps/i18n-resource-wrapper'; ``` 2.配置多语言相关属性 ``` let i18nProps = { lng: 'zh_TW', // 当前语言 debug: true, // debug 模式时,每次都会走远程接口 i18nSite: 'i18n.italent-inc.cn', // 多语言站点,用以区分不同环境 // applica

Readme

使用方法

1.引入多语言 wrapper

import I18NWrapper from '@beisen-cmps/i18n-resource-wrapper';

2.配置多语言相关属性

let i18nProps = {
    lng: 'zh_TW', // 当前语言
    debug: true, // debug 模式时,每次都会走远程接口
    i18nSite: 'i18n.italent-inc.cn', // 多语言站点,用以区分不同环境
    // application: 'BeisenCloudDemo', // 选填,获取指定应用下的数据
    namespaces: ['Italent$Page$PageDynamic', 'Italent$CommonModule'], // 获取指定 namespace 下的数据
    platform: 'isSysRes', // 选填,仅当使用系统级组件时才用到
    ajaxMethod: function (){}, // 选填,仅当宿主环境无法调用常规 ajax 时使用,例如移动端外壳中
    transList: ['autoTree.thisLevel', 'nothing.text'], // 所需翻译的列表
    callback: function (){
        console.info('success!');
    }
};
return (
    <I18NWrapper {...i18nProps}>
        <你的组件 />
    </I18NWrapper>
);

3.在组件中使用相关属性
props 中会有两个属性和多语言相关

  • translation
    内容是 props 中传递的所有 key 的翻译对象
  • I18NSDK
    内容是当前组件使用的多语言翻译对象,可以正常使用 I18NTools 中的所有 api,具体可见该组件的文档。
    http://gitlab.beisencorp.com/ux-cnpm/i18n-tools

4.注意事项

  • I18NTools 的初始化已经在 wrapper 中完成,不需要再次调用 init 方法。
  • 目前没有做接口请求时的 loading 处理,组件展示时会有 props 变化造成的变更,即一开始是中文,然后等接口返回变成了英文,这样的情况是可能存在的。
  • 明确一下,这个 wrapper 只是做了一层简单封装,也就是仅有子组件顶层可以拿到方法和对象的引用。这并不是 provider,也不提供全局的下发功能。你可以在自己的组件中自由决定如何处理多语言问题,而不应该受到本工具的限制。