i18n-translator

AI-powered translation tool for your i18n JSON files. Automate translations for Next.js, Node.js, NestJS, and React applications.

Node.js 14+ TypeScript MIT License Production Ready

Features

Next.js Ready

Perfect for Next.js i18n with next-i18next. Translate your locale JSON files instantly

Node.js & NestJS

Works seamlessly with NestJS i18n package and any Node.js i18n setup

AI-Powered

Uses GroqCloud LLM for fast, accurate translations powered by AI

Recursive Processing

Handles nested locale directories and preserves your i18n folder structure

Structure Preserved

Only translates string values, keeps your JSON keys and structure intact

Fast & Reliable

Built-in rate limiting, retry logic, and progress tracking

How It Works

Input JSON

{
  "name": "Hello World",
  "description": "This is an example JSON file for testing the translator",
  "count": 42,
  "active": true,
  "nullValue": null,
  "nestedObject": {
    "title": "Welcome to the Translator",
    "subtitle": "Translate your static content easily",
    "items": [
      "First item",
      "Second item",
      "Third item"
    ],
    "metadata": {
      "author": "Developer",
      "version": "1.0.0"
    }
  },
  "arrayOfStrings": [
    "Apple",
    "Banana",
    "Cherry"
  ],
  "mixedArray": [
    "String value",
    123,
    true,
    "Another string"
  ]
}

Output JSON (French)

|

Quick Installation

Terminal
# Clone the repository
git clone https://github.com/ankurrokad/i18n-translator.git
cd i18n-translator

# Install dependencies
pnpm install

# Set up API key
cp .env.example .env
# Edit .env and add your GROQ_API_KEY

# Build the project
pnpm run build

# Translate your i18n files!
pnpm start translate

Usage Examples

Translate all files

pnpm start translate

Translate specific file

pnpm start translate myfile.json

Translate to Spanish

pnpm start translate --lang es

Dry run (preview)

pnpm start translate --dry-run

Ready to translate your JSON files?

Get started in minutes with our easy-to-use CLI tool