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

lingui-translate

v0.1.8

Published

CLI for translating missing Lingui PO entries with an LLM.

Readme

lingui-translate

lingui-translate is a small CLI that fills missing Lingui messages.po translations with an LLM.

Missing translations are easy to leave behind, especially when strings change often or several locales need to stay in sync. This package scans your Lingui locale folders, finds untranslated entries, and writes translations back into the existing messages.po files. The result is a faster localization workflow with less repetitive copy/paste and more consistent wording across a locale.

Quick start

Install it:

npm install --save-dev lingui-translate

Set an API key:

export OPENAI_API_KEY=your_api_key_here

Run it on your locales:

npx lingui-translate --locales-dir src/locales --languages de es

That is enough to get started. If your project uses the default src/locales layout, you can also keep the command very small by moving options into a config file.

Usage

Translate specific languages:

lingui-translate --locales-dir src/locales --languages de es

Preview changes without writing files:

lingui-translate --locales-dir src/locales --languages de es --dry-run

Use a custom model and prompt:

lingui-translate \
  --locales-dir src/locales \
  --languages de es \
  --model gpt-5.4 \
  --system-prompt "You are a concise product localization translator."

Use a different provider:

lingui-translate \
  --provider anthropic \
  --model claude-3-5-sonnet-latest \
  --locales-dir src/locales \
  --languages de

Config

The CLI can auto-load:

  • lingui-translate.config.json
  • lingui-translate.config.js
  • lingui-translate.config.mjs
  • lingui-translate.config.cjs

Example:

export default {
  localesDir: "src/locales",
  languages: ["de", "es"],
  workers: 4,
  provider: "openai",
  model: "gpt-5.4",
  systemPrompt:
    "You are a professional translator specializing in software localization.",
};

Then you can run:

npx lingui-translate

CLI flags override config file values.

Defaults

If you do not provide config, flags, or environment variables, lingui-translate uses:

  • localesDir: src/locales
  • dryRun: false
  • workers: 4
  • provider: openai
  • model: depends on provider
    • openai: gpt-5.4
    • anthropic: claude-sonnet-4-6
    • google: gemini-2.5-flash
  • systemPrompt: You are a professional translator specializing in software localization. Pay careful attention to the provided examples to maintain consistency in style and terminology.

There is no default API key or base URL. The API key must be provided through a provider-specific env var, LINGUI_TRANSLATE_API_KEY, or --api-key.

Environment

  • LINGUI_TRANSLATE_PROVIDER
  • LINGUI_TRANSLATE_API_KEY
  • LINGUI_TRANSLATE_BASE_URL
  • OPENAI_API_KEY
  • OPENAI_BASE_URL
  • ANTHROPIC_API_KEY
  • ANTHROPIC_BASE_URL
  • GOOGLE_GENERATIVE_AI_API_KEY
  • GOOGLE_GENERATIVE_AI_BASE_URL
  • LINGUI_TRANSLATE_LOCALES_DIR
  • LINGUI_TRANSLATE_LANGUAGES as a comma-separated list
  • LINGUI_TRANSLATE_WORKERS
  • LINGUI_TRANSLATE_MODEL
  • LINGUI_TRANSLATE_SYSTEM_PROMPT

Exit codes

  • 0: success, whether or not translations were written
  • 1: any CLI or translation error