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

andola-i18n-generator

v1.0.7

Published

i18n translation generator with automatic unwrapping support and error recovery.

Downloads

38

Readme

i18n Generator

i18n translation generator with automatic unwrapping support and error recovery.

Installation

npm install --save-dev andola-i18n-generator

Usage

Basic usage (generates with metadata)

i18n-generator --source en.json --target generatedLanguages/or.json --lang or

With automatic unwrap (for React apps)

i18n-generator --source public/locales/en/translation.json --target i18n/generated/or.json --lang or --unwrap public/locales/or/translation.json

In package.json (single language)

{
  "scripts": {
    "translate:or": "i18n-generator --source public/locales/en/translation.json --target i18n/generated/or.json --lang or --unwrap public/locales/or/translation.json",
    "translate:hi": "i18n-generator --source public/locales/en/translation.json --target i18n/generated/hi.json --lang hi --unwrap public/locales/hi/translation.json"
  }
}

In package.json (dynamic language - pass language as argument)

{
  "scripts": {
    "translate": "bash -c 'LANG=${1:-or}; i18n-generator --source public/locales/en/translation.json --target i18n/generated/$LANG.json --lang $LANG --unwrap public/locales/$LANG/translation.json' bash"
  }
}

Then run with any language code:

npm run translate or
npm run translate hi
npm run translate es

Features

Automatic unwrapping - Generates both metadata version (for resuming) and clean version (for React)
Error recovery - Saves partial translations on rate limit errors
Resume capability - Continue from where it stopped when re-run
Incremental updates - Only translates new or missing keys

Parameters

  • --source: Path to source English JSON file (required)
  • --target: Path to save generated translation with metadata (required)
  • --lang: Target language code - e.g., or, hi, es, fr, de (required)
  • --unwrap: Path to save unwrapped plain translation for React/i18next (optional)

How It Works

  1. Generates with metadata: Creates a file with { value: "translation", is_generated: true } structure
  2. Saves incrementally: After each successful translation, saves progress to file
  3. Handles errors: On rate limit or network errors, keeps partial data
  4. Auto unwraps: If --unwrap is provided, creates a clean JSON file ready for React
  5. Resumes work: Re-running continues from where it left off

Error Handling

When rate limited or network errors occur:

  • ✅ Partial translations are saved to the target file
  • ✅ Unwrapped version is created from partial data
  • 💡 Wait a few minutes and re-run to continue

For Publishing to NPM

Before publishing new update:

  1. Update "version": "1.0.7" in package.json
  2. Run: npm publish