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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sayyyat/smart-i18n

v3.0.3

Published

Reusable Gulp-based i18n automation system for javascript/typescript projects.

Downloads

1,123

Readme

⚠️ DEPRECATED

This package is no longer maintained. Please migrate to the new, next-generation CLI: @sayyyat/smart-i18next-cli

Why migrate?

  • 🚀 Pure TypeScript: The new CLI is built entirely in TypeScript for better stability.
  • ⚡️ AST Parsing: Uses i18next-cli (AST) instead of Regex/Gulp for smarter extraction.
  • 💎 Better Features: Full support for <Trans> components, stricter type generation, and faster execution.

@sayyyat/smart-i18n (Legacy)

npm version npm downloads License CI/CD Status

Core CLI Package. A Gulp-based CLI toolkit for modular, scalable i18n in JS/TS projects.

This package provides the core, framework-agnostic CLI for the smart-i18n system. It automates namespace generation, key extraction, machine translation, and TypeScript typing.


❗️ Note for React / Next.js Users

This is the core package. If you are working with React or Next.js, you should install the @sayyyat/smart-i18n-react package instead.

The React package includes all commands from this core package, plus React-specific init templates and create-feature (FSD) scaffolding.

➡️ @sayyyat/smart-i18n-react README


🚀 Features

  • ✅ Automatic namespace detection and key extraction from your code.
  • 🔄 Seamless translation file merging (preserves existing keys).
  • 🌐 On-demand machine translation of missing keys via RapidAPI (using key == value detection).
  • 🔒 Safe TypeScript typings generation (generate:types).
  • ⚙️ Runtime Config Generation (generate:config) from a single source of truth (i18next.config.json).
  • 🧱 Modular Gulp tasks for fully scriptable and extendable i18n pipelines.

💾 Installation

Install this package as a development dependency:

# pnpm
pnpm add @sayyyat/smart-i18n -D

# yarn
yarn add @sayyyat/smart-i18n -D

# npm
npm install @sayyyat/smart-i18n --save-dev

⚙️ Configuration & Usage

This package is designed to be run from within a consumer project.

1. Configuration

The entire system is controlled by a single i18next.config.json file in your project root.

Run the init command to automatically create a default config file:

npx smart-i18n init

This will create i18next.config.json and a .demo-env file. The CLI reads all settings (languages, paths, etc.) from this JSON file.

2. Core CLI Commands

All commands are available via npx or package.json scripts.

  • npx smart-i18n (Default task)

    • Runs the main generation pipeline in order:
    1. generate-config (Updates src/i18n/lib/config.ts from i18next.config.json)
    2. generate-namespaces (Scans code for new namespaces)
    3. generate-templates (Scans code for new keys)
    4. generate-types (Generates TypeScript types from keys)
  • npx smart-i18n generate-translations

    • This is the "killer feature".
    • Scans all locale files (e.g., kk/common.json).
    • Finds all keys where key === value (meaning they are not translated yet).
    • Sends the key (which is the full English text) to RapidAPI for translation.
    • Caches requests to avoid duplicate API calls and save costs.
  • npx smart-i18n watch

    • Runs the default task automatically when your source files change.
  • npx smart-i18n help

    • Displays a full list of all available commands.

🔗 Example Integration

A Next.js 16 example application that uses this tooling is available in the monorepo:

➡️ apps/next-i18n


⚖️ License

MIT © Sayat Raykul