Back to Explore

amannn/po-parser

GitHub
1 updates · last 90 days2 watchersOpen source

Last release:

Parses and serializes `.po` (gettext) file content in TypeScript, providing a small, zero-dependency parser. It’s useful for reading `.po` message entries like `msgid` and `msgstr`, including metadata, message context (`msgctxt`), and references and comments that start with `#.` or `#,`, then converting it to or from structured data.

Project status

  • Actively maintained, with the most recent update on 2026-08-14, about a 2-week gap since the prior day’s activity and no long evidence of neglect up to today (2026-08-20).
  • Update cadence appears fairly steady across 2025-11 to 2026-08, with notable updates roughly every few weeks to a few months early on, and a more recent update in mid-August 2026; last upstream push matches the v2.2.0 date.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v2.2.0

    v2.2.0 adds support for parsing PO multi-line string values by treating subsequent quoted lines as continuations of the last msgid, msgstr, or msgctxt keyword. The parser now concatenates those continued lines instead of throwing an error when encountering quoted lines in entry mode.

    Features
  • v2.1.1

    The provided release notes for v2.1.1 only mention a publishing retry. However, the actual code diff includes functional changes to how PO reference comments ("#:") are parsed and serialized, adding support for reference line numbers.

  • v2.1.0

    v2.1.0 adds support for capturing line numbers from PO reference comments (the "#:" lines) during parsing. It also updates serialization so that if a reference includes a line number, the emitted reference includes "path:line". TypeScript typings and tests were updated to reflect the new optional `line` field on `references` entries.

    Features
  • v2.0.0

    v2.0.0 primarily refactors the public API types, replacing the old `Message` shape with a PO-spec-aligned `Entry` type. The runtime parser/serializer was updated to use `msgctxt`, `msgid`, and `msgstr` directly, and it now supports `#.` extracted comments as a list rather than a single description.

    BreakingFeatures
  • v1.0.2

    v1.0.2 introduces special-character handling for PO parsing and serialization, specifically by adding escaping and unescaping logic. The parser now converts escaped sequences inside quoted fields into real characters, and the serializer emits escaped sequences for special characters.

  • v1.0.1

    Release v1.0.1 is presented as a CI publishing fix. The code diff shows updates to the semantic-release pipeline, adding NPM publishing support and related configuration changes, along with minor semantic-release GitHub plugin option adjustments.

    Security
  • v1.0.0

    v1.0.0 introduces the initial implementation of the project and adds support for flags. This release expands parsing capabilities, enabling additional constructs to be recognized during processing.

    Features