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

po-fill

v1.0.0

Published

Extract → Translate (OpenAI) → Apply for PO files with AI translation

Readme

po-fill

Extract → Translate (OpenAI) → Apply for PO files with AI translation

A powerful Node.js tool for automatically translating PO (gettext) files using OpenAI's GPT models. Supports batch processing, language detection, and comprehensive reporting.

Features

  • Extract: Extract translatable strings from PO files
  • Translate: Use OpenAI GPT models for AI-powered translation
  • Apply: Apply translations back to PO files with validation
  • Autofill: Complete workflow in one command
  • Language Lock: Ensures translations stay in target language
  • Batch Processing: Efficient handling of large files
  • Comprehensive Reporting: Detailed logs and error tracking

Installation

Global installation (recommended)

npm install -g po-fill

Local installation

npm install po-fill

Setup

  1. Set your OpenAI API key:
export OPENAI_API_KEY=sk-your-api-key-here
  1. Install dependencies:
npm install

Usage

Command Line Interface

# Extract translatable strings
po-fill extract <input.po> <translations.jsonl> [--full]

# Translate using OpenAI
po-fill translate <input.po> <in.jsonl> <out.jsonl> [--to "Language"] [--batch N] [--model MODEL] [--temp X] [--effort minimal|low|medium|high] [--no-spinner]

# Apply translations
po-fill apply <input.po> <in.jsonl> <output.po> [--to "Language"] [--lang-code XX[_YY]]

# Complete workflow
po-fill autofill <input.po> <output.po> [--full] [--to "Language"] [--lang-code XX[_YY]] [--batch N] [--model MODEL] [--temp X] [--effort minimal|low|medium|high] [--no-spinner]

Options

  • --full: Extract ALL msgid entries (not just empty ones)
  • --to "Language": Target language for translation
  • --lang-code XX[_YY]: Update PO header Language field (e.g., fi, fi_FI)
  • --batch N: Batch size for translation (default: 100)
  • --model MODEL: OpenAI model to use (default: gpt-5-mini)
  • --temp X: Temperature setting for AI model
  • --effort: Reasoning effort level for GPT-5 models
  • --no-spinner: Disable progress spinner

Examples

# Extract Finnish translations from English PO
po-fill extract en_GB.po fi_translations.jsonl --full

# Translate to Finnish using GPT-5
po-fill translate en_GB.po fi_translations.jsonl fi_filled.jsonl --to "Finnish" --model gpt-5

# Apply translations and update headers
po-fill apply en_GB.po fi_filled.jsonl fi.po --to "Finnish" --lang-code fi

# Complete workflow in one command
po-fill autofill en_GB.po fi.po --full --to "Finnish" --lang-code fi --model gpt-5-mini

Supported Models

  • GPT-5: gpt-5, gpt-5-mini, gpt-5-nano
  • Fallback Support: Automatic fallback for unsupported parameters
  • Language Lock: Prevents language drift with automatic fix passes

JSONL Format

The tool uses JSONL (JSON Lines) format for intermediate files:

{"msgctxt": null, "msgid": "Hello", "pluralIndex": 0, "src": "Hello", "tgt": ""}
{"msgctxt": "context", "msgid": "World", "pluralIndex": 0, "src": "World", "tgt": ""}

Requirements

  • Node.js 16.0.0 or higher
  • OpenAI API key
  • Dependencies: gettext-parser, openai

License

MIT

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Support

For issues and questions, please check the GitHub repository or create an issue.