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

i18n-json-translator

v1.0.1

Published

JSON internationalization translator using Google Gemini API

Readme

I18n JSON Translator

Overview

A powerful Node.js application for translating JSON files across multiple languages using the Google Gemini API. This tool is designed to simplify internationalization (i18n) workflows by automatically translating nested JSON structures.

Features

  • 🌐 Supports complex, nested JSON translations
  • 🚀 Chunk-based translation to handle large files
  • 🛡️ Robust error handling
  • 📦 Preserves original JSON structure
  • 🔧 Configurable translation parameters

Prerequisites

  • Node.js (v16+ recommended)
  • Google Gemini API Key

Installation

  1. Clone the repository:
git clone https://github.com/esamani77/i18n-json-translator.git
cd i18n-json-translator
  1. Install dependencies:
npm install
  1. Create a .env file in the project root:
GEMINI_API_KEY=your_google_gemini_api_key_here

Configuration

Edit src/index.ts to customize translation settings:

await translationManager.translateLargeJson({
  inputJsonPath: "./input.json", // Path to input JSON
  outputDir: "./translations", // Output directory
  sourceLanguage: "en", // Source language code
  targetLanguage: "es", // Target language code
  chunkSize: 5, // Translation chunk size
  delayBetweenRequests: 1500, // Delay between API calls
});

Usage

Running the Translator

npm start

Translation Parameters

  • inputJsonPath: Path to the JSON file you want to translate
  • outputDir: Directory where translated files will be saved
  • sourceLanguage: Original language of the JSON (e.g., 'en')
  • targetLanguage: Target language for translation (e.g., 'es', 'fr')
  • chunkSize: Number of items to translate in each API request
  • delayBetweenRequests: Milliseconds between chunk translations

Example Input JSON

{
  "page": {
    "langs": {
      "en-uk": "English (UK)",
      "en-us": "English (US)"
    },
    "navigation": {
      "home": "Home",
      "about": "About"
    }
  }
}

Supported Languages

The translator supports most languages recognized by the Google Gemini API, including:

  • English
  • Spanish
  • French
  • German
  • Arabic
  • Chinese
  • Russian
  • And many more!

Troubleshooting

  • Ensure your Gemini API key is valid
  • Check internet connectivity
  • Verify input JSON structure
  • Monitor console for detailed error messages

Rate Limiting

To prevent API rate limits:

  • Adjust chunkSize and delayBetweenRequests
  • Use smaller chunk sizes for large files
  • Implement exponential backoff if needed

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

[MIT License]

Disclaimer

This tool uses the Google Gemini API. Ensure compliance with Google's terms of service and API usage guidelines.

Support

For issues or questions, please open a GitHub issue or contact the maintainer.