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

polyglot-keeper

v1.3.1

Published

AI-powered i18n synchronization tool that automatically translates missing keys and maintains perfect structural consistency across all locale files.

Readme

Polyglot Keeper

🇺🇸 English | 🇷🇺 Русский

npm version npm downloads License: MIT

An AI-powered i18n synchronization tool that automatically translates missing keys and maintains perfect structural consistency across all your locale and markdown files.

Works seamlessly with any framework (React, Vue, Svelte, Angular) and any i18n library.

| Before | After | | :------------------------------------: | :----------------------------------: | | Before | After |

✨ Features

  • AI Translation — Translates missing keys using Gemini, OpenAI, or Anthropic.
  • Change Tracking — Detects when source values change and updates translations (off / on / carefully).
  • Structure Mirroring — Keeps target files perfectly aligned with the source key structure and order.
  • Clean Up — Automatically removes obsolete keys that no longer exist in the primary locale.
  • Reliable Processing — Built-in batch processing with configurable retry and backoff settings.
  • Interactive Setup — Guided CLI wizard to get you started in seconds.

🚀 Quick Start

1. Install the package

npm install -D polyglot-keeper

2. Initialize your project

npx polyglot-keeper init

This creates polyglot.config.json and a .env file.

3. Add your API key

Open the newly created .env file and add your provider's API key (Gemini, OpenAI, or Anthropic).

POLYGLOT_API_KEY=your_api_key_here

4. Run the sync

# Sync JSON locales
npx polyglot-keeper sync

# Or sync Markdown files
npx polyglot-keeper sync --md

⚙️ Configuration

Your setup is managed via polyglot.config.json.

{
  "envFile": ".env",
  "json": {
    "provider": "gemini",
    "model": "gemini-flash-latest",
    "envVarName": "POLYGLOT_API_KEY",
    "localeFormat": "short",
    "locales": ["EN", "RU"],
    "defaultLocale": "EN",
    "localesDir": "src/i18n",
    "trackChanges": "carefully",
    "batchSize": 200,
    "batchDelay": 2000,
    "retryDelay": 35000,
    "maxRetries": 3
  },
  "markdown": {
    "provider": "gemini",
    "model": "gemini-flash-latest",
    "envVarName": "POLYGLOT_MD_API_KEY",
    "contentDir": "content",
    "defaultLocale": "en",
    "locales": ["en", "ru"],
    "trackChanges": "carefully",
    "batchSize": 200,
    "batchDelay": 2000,
    "retryDelay": 35000,
    "maxRetries": 3,
    "exclude": ["drafts/**", "private/**", "README.md"]
  }
}

Locale Formats

  • short: Simple locale codes (e.g., en.json, ru.json)
  • pair: BCP 47 format (e.g., en-US.json, ru-RU.json)

Change Tracking Modes

By default, the tool only translates missing keys. You can enable trackChanges in your config to handle source file modifications:

  • "off" — Default. Only translate new keys, ignore changes to existing values.
  • "on" — Automatically retranslate all target keys when the source key changes.
  • "carefully" — Interactive review. The CLI will prompt you for each changed key to either retranslate, skip, or freeze it.

Note: Enabling tracking creates a .polyglot-lock.json file. Freezing a key locks it from future retranslations (useful for manual overrides). Use sync --force to clear frozen keys.

.polyglot-lock.json uses sectioned storage:

{
  "json": {
    "__frozen": ["some.key"],
    "values": {
      "some.key": "Source snapshot value"
    }
  },
  "md": {
    "__frozen": ["docs/readme.md"],
    "values": {
      "docs/readme.md": "<sha256 hash>"
    }
  }
}

Markdown Exclusions

When syncing Markdown files (sync --md), you can exclude specific files or directories from translation by adding an exclude array to your markdown config. Patterns support glob-style matching:

{
  "markdown": {
    "exclude": ["drafts/**", "private/**", "README.md", "**/*.draft.md"]
  }
}

This is useful for excluding draft content, private notes, or files that shouldn't be translated.


💻 CLI Commands

| Command | Description | | :--------------------------------- | :--------------------------------------- | | npx polyglot-keeper init | Start the interactive setup wizard | | npx polyglot-keeper sync | Sync and translate JSON locale files | | npx polyglot-keeper sync --md | Sync and translate Markdown files | | npx polyglot-keeper sync --force | Force retranslation of all existing keys |


🛠 Requirements

  • Node.js 20+
  • A valid API key for Google Gemini, OpenAI, or Anthropic

🤝 Contributing

  1. Clone the repo and run npm install
  2. Run quality checks before submitting a PR:
npm run lint
npm run typecheck
npm run test
npm run build

📄 License

MIT © David Aganov