Skip to main content

PoSync is an open-source CLI tool that automatically syncs .po file msgid keys with applied corrections and updates the source code at the exact lines referenced in the .po, eliminating tedious manual replacements.

Project description

PoSync

PoSync is an open-source command-line tool designed to automatically synchronize .po file keys (msgid) with applied corrections and update your source code accordingly.
It is ideal for projects using React, Vue, Angular, or any framework that leverages .po files for internationalization (i18n).

🚀 Why PoSync?

When using .po files for translations, the original language is often repeated in the msgid.
If you fix a typo or update text, you normally need to manually update all references in your codebase — a tedious and error-prone process.

PoSync automates this workflow by:

  • Detecting modified msgids based on the corrected msgstr
  • Updating the source code automatically at the exact lines indicated in the .po file
  • Updating the msgid in the .po file itself to keep everything in sync
  • Working seamlessly on Mac and Linux

✨ Features

  • 🔍 Smart .po analysis using occurrence information (#: file:line)
  • 🔄 Automatic source code replacement at the precise lines
  • 🗂 Direct update of msgid in the .po file
  • 🛠 No approximate regex — only replaces where necessary
  • 📦 Easy installation via pip or Homebrew (Mac/Linux)

📥 Installation

Install via pip:

pip install po_sync

💡Basic Usage

po_sync path/to/messages.po
  • path/to/messages.po — Path to the .po file containing corrections.

Optional Arguments

Flag Description Default
-h, --help Show the help message
-d [FOLDER_PATH], --base-project [FOLDER_PATH] Path to the base project folder current working directory
-c, --clear Clear msgstr after processing
-t, --dry-run Perform a dry run without modifying any files; useful to preview changes
-v, --verbose Enable verbose output for detailed information about what will be updated
-y, --yes Skip confirmation prompts and apply changes automatically

Examples

  • Default run (apply corrections from .po file to source code):
po_sync messages.po
  • Dry run (preview changes without modifying files):
po_sync messages.po --dry-run
  • Specify project folder:
po_sync messages.po --base-project dist/ message.po
  • Verbose output with automatic confirmation:
po_sync messages.po --verbose --yes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

po_sync-1.0.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

po_sync-1.0.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file po_sync-1.0.0.tar.gz.

File metadata

  • Download URL: po_sync-1.0.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for po_sync-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2aac819bddee2f91f232fd830598642596b154e83d590b30aeb935b69786f276
MD5 75c1191e92a237601d78ba21ed691705
BLAKE2b-256 4e39b0cee77fb259db53d1653ab7d36990186a484b8ff25de918de6be0fe3016

See more details on using hashes here.

Provenance

The following attestation bundles were made for po_sync-1.0.0.tar.gz:

Publisher: publish-to-pypi.yml on davaxi/po_sync

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file po_sync-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: po_sync-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for po_sync-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7fb187837805d88898d8314fcab394fba81058357f711ced449b261ac92cc3a7
MD5 4a79976718eae7a7e4a4fa27f7ea288f
BLAKE2b-256 4ede74ffbe7ed2ab8408cb5e5f246e18d4fdfe3fc299800629d21c99df727125

See more details on using hashes here.

Provenance

The following attestation bundles were made for po_sync-1.0.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on davaxi/po_sync

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page