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

@routed/ai-localize

v1.0.6

Published

Zero-config i18n extractor and translator CLI

Readme

AI Translation CLI

Zero-config i18n extraction and translation CLI tool to automate the internationalization process for your JavaScript and TypeScript projects.

Features

  • 🔍 Automatically extracts strings from JSX/TSX files
  • 🌐 Translates content using LLMs
  • 🚀 GitHub Actions integration for continuous translation
  • ⚙️ Zero configuration by default
  • 📊 Plan usage monitoring

Visit simacloud.dev to get your credentials. Get started for FREE with 5000 words.

Installation

npm i @routed/ai-localize@latest

Quick Start

  1. Initialize the configuration and GitHub workflow
npx ai-localize init
  1. Set up your API credentials

Create a .env file in your project root:

SIMA_API_KEY=your_api_key
  1. Extract strings from your source code
npx ai-localize extract
  1. Translate extracted strings
npx ai-localize translate
  1. Rewrite the translated text in JSON format

Rewrites your source files, replacing raw JSX text with an object that holds every available translation:

npx ai-localize insert

Configuration

After running init, you'll have an ai-translation.config.js file in your project root:

// ai-translation.config.js
module.exports = {
  locale: { 
    source: 'en', 
    targets: ['es', 'fr', 'ru'] 
  },
  paths: { 
    src: 'src/**/*.{js,jsx,ts,tsx}', 
    output: 'i18n/{{locale}}' 
  }
};

Configuration Options

| Option | Description | |--------|-------------| | locale.source | Source language code (e.g., 'en') | | locale.targets | Array of target language codes to translate into | | paths.src | Glob pattern for source files to extract strings from | | paths.output | Output directory pattern for translation files |

Available Commands

init

Generates configuration file and GitHub Actions workflow for continuous translation.

npx ai-localize init

extract

Scans your source code and extracts text strings into JSON files in the source locale directory.

npx ai-localize extract

translate

Translates extracted strings to all target languages configured in your settings.

npx ai-localize translate

usage

Shows your current Sima API plan, token usage, and request count.

npx ai-localize usage

GitHub Actions Integration

The init command creates a GitHub Actions workflow file (.github/workflows/i18n.yml) that:

  1. Runs on pull requests and pushes
  2. Extracts strings from your source code
  3. Translates them to target languages
  4. Commits the translation files back to your repository

You need to set SIMA_API_KEY and SIMA_USER_ID as secrets in your GitHub repository.

How It Works

String Extraction

The CLI scans JSX and TSX files for text content within JSX tags and extracts them into individual JSON files in the i18n/en/ directory (or your configured source locale).

Translation Process

The extracted strings are sent to the Sima API for translation into your target languages, and the results are saved in corresponding directories (e.g., i18n/es/ for Spanish).

Environment Variables

| Variable | Description | |----------|-------------| | SIMA_API_KEY | Your Sima API key for authentication |

Supported File Types

  • JavaScript (.js)
  • TypeScript (.ts)
  • JSX (.jsx)
  • TSX (.tsx)

Getting API Credentials

To obtain your Sima API credentials:

  1. Sign up at simacloud.dev
  2. Navigate to your account settings
  3. Generate or copy your API key

The user should go to https://simacloud.dev/ to get his credentials and to see a short demo.

LLM provider and supported languages

AI Translation CLI uses Llama-3.3-70B-Versatile from Groq for fast AI inference, ensuring quick and accurate translations across all supported languages.

The tool supports translation between 36 languages: English (en), Chinese Simplified (zh-cn), Spanish (es), Arabic (ar), Portuguese (pt), Indonesian (id), French (fr), Japanese (ja), Russian (ru), German (de), Turkish (tr), Korean (ko), Italian (it), Persian/Farsi (fa), Thai (th), Dutch (nl), Polish (pl), Ukrainian (uk), Vietnamese (vi), Hebrew (he), Greek (el), Czech (cs), Swedish (sv), Hungarian (hu), Finnish (fi), Norwegian (no), Danish (da), Romanian (ro), Bulgarian (bg), Croatian (hr), Slovak (sk), Lithuanian (lt), Latvian (lv), Estonian (et), Slovenian (sl), and Catalan (ca).

You can configure any of these languages as your source language and translate to any combination of the others as target languages in your ai-translation.config.js file.

Troubleshooting

Common Issues

Error: Set SIMA_API_KEY

Make sure you've set this environment variable either in a .env file or directly in your terminal.

Translation not working on GitHub Actions

Ensure that you've added the required secrets to your GitHub repository settings.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements