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 correctedmsgstr - Updating the source code automatically at the exact lines indicated in the
.pofile - Updating the
msgidin the.pofile itself to keep everything in sync - Working seamlessly on Mac and Linux
✨ Features
- 🔍 Smart
.poanalysis using occurrence information (#: file:line) - 🔄 Automatic source code replacement at the precise lines
- 🗂 Direct update of
msgidin the.pofile - 🛠 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.pofile 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
.pofile 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2aac819bddee2f91f232fd830598642596b154e83d590b30aeb935b69786f276
|
|
| MD5 |
75c1191e92a237601d78ba21ed691705
|
|
| BLAKE2b-256 |
4e39b0cee77fb259db53d1653ab7d36990186a484b8ff25de918de6be0fe3016
|
Provenance
The following attestation bundles were made for po_sync-1.0.0.tar.gz:
Publisher:
publish-to-pypi.yml on davaxi/po_sync
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
po_sync-1.0.0.tar.gz -
Subject digest:
2aac819bddee2f91f232fd830598642596b154e83d590b30aeb935b69786f276 - Sigstore transparency entry: 398024817
- Sigstore integration time:
-
Permalink:
davaxi/po_sync@d9b2ac59ef4ad615d202f6c5c9bd75586b58575c -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/davaxi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@d9b2ac59ef4ad615d202f6c5c9bd75586b58575c -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fb187837805d88898d8314fcab394fba81058357f711ced449b261ac92cc3a7
|
|
| MD5 |
4a79976718eae7a7e4a4fa27f7ea288f
|
|
| BLAKE2b-256 |
4ede74ffbe7ed2ab8408cb5e5f246e18d4fdfe3fc299800629d21c99df727125
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
po_sync-1.0.0-py3-none-any.whl -
Subject digest:
7fb187837805d88898d8314fcab394fba81058357f711ced449b261ac92cc3a7 - Sigstore transparency entry: 398024822
- Sigstore integration time:
-
Permalink:
davaxi/po_sync@d9b2ac59ef4ad615d202f6c5c9bd75586b58575c -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/davaxi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@d9b2ac59ef4ad615d202f6c5c9bd75586b58575c -
Trigger Event:
push
-
Statement type: