🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

po-sync

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

po-sync

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.

pipPyPI
Version
1.0.0
Maintainers
1

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

FlagDescriptionDefault
-h, --helpShow the help message
-d [FOLDER_PATH], --base-project [FOLDER_PATH]Path to the base project foldercurrent working directory
-c, --clearClear msgstr after processing
-t, --dry-runPerform a dry run without modifying any files; useful to preview changes
-v, --verboseEnable verbose output for detailed information about what will be updated
-y, --yesSkip 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

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts