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

@i18nflow/react-i18next

v0.2.2-beta.0

Published

Complete react-i18next solution for i18nflow

Readme

@i18nflow/react-i18next

完整的 react-i18next 可视化调试解决方案。

🚧 Beta 版本: 目前处于 Beta 阶段,API 可能会发生变化。欢迎尝试并反馈问题。

特性

  • 运行时 Proxy - 自动为翻译内容添加 data-i18n-key 标记
  • 🔧 编译时转换 - Babel 插件自动识别 t() 调用和 <Trans> 组件
  • 🎯 可视化调试 - 按住快捷键点击翻译内容即可编辑
  • 🚀 即时生效 - 修改后自动写入文件并触发 HMR
  • 🌍 多框架支持 - 支持 Next.js、Vite 等主流框架

安装

pnpm add -D @i18nflow/react-i18next

快速开始

Next.js

// next.config.js
const { ReactI18nextNextPlugin } = require('@i18nflow/react-i18next/plugin-next');

module.exports = {
  // ... 其他配置
  webpack: (config, { dev }) => {
    if (dev) {
      config.plugins.push(
        new ReactI18nextNextPlugin({
          localeDir: 'src/i18n/locales',
          locales: ['zh-CN', 'en-US'],
        })
      );
    }
    return config;
  },
};

Vite

// vite.config.ts
import { ReactI18nextVitePlugin } from '@i18nflow/react-i18next/plugin-vite';

export default defineConfig({
  plugins: [
    ReactI18nextVitePlugin({
      localeDir: 'src/i18n/locales',
      locales: ['zh-CN', 'en-US'],
    }),
  ],
});

在应用中使用

方式 1:自闭合标签(推荐 - 可在服务端组件中使用)

import { I18nDebugProvider } from '@i18nflow/react-i18next';

// Next.js App Router - 保持服务端组件
export default function Layout({ children }) {
  return (
    <html>
      <body>
        {children}
        {/* 不需要包裹 children,使用自闭合标签 */}
        <I18nDebugProvider enabled={process.env.NODE_ENV === 'development'} />
      </body>
    </html>
  );
}

方式 2:包裹 children(兼容旧版)

'use client'; // 需要添加 'use client' 指令

import { I18nDebugProvider } from '@i18nflow/react-i18next';

function App() {
  return (
    <I18nDebugProvider enabled={process.env.NODE_ENV === 'development'}>
      {/* 你的应用 */}
    </I18nDebugProvider>
  );
}

工作原理

  1. 编译时:Babel 插件识别 t() 调用和 <Trans> 组件,提取翻译 key
  2. 运行时:Proxy 包装 i18next 实例,为翻译内容添加 data-i18n-key 属性
  3. 交互时:按住快捷键(Ctrl/Cmd)点击翻译内容,打开编辑弹窗
  4. 更新时:修改保存后,自动写入翻译文件并触发 HMR

License

MIT