Script to merge translations from a set of po files to other set of po files.
pomerge does not care about .po file names, a translation from one file can land in another as long as their msgid are identical.
Usage
Basic usage is pomerge --from source.po --to dest.po, see pomerge --help for more.
--from and --to are optional, when not given, pomerge will use a temporay file. So:
pomerge --from a/**/*.po --to b/**/*.po
is strictly equivalent to:
pomerge --from a/**/*.po pomerge --to b/**/*.po
The wrapping of your .po files is not kept by pomerge, completly destroying the readability of git diffs, to fix this I use poindent.
Recipes
Propagating translations from a directory to another
When you’re having two directories with .po files and want to copy translations (msgstr) from one to another, even if the hiearchy is not the same, run:
pomerge --from ../contributors/**/*.po --to **/*.po
In this case, two options can be useful:
--no-overwrite: Avoid touching already translated strings.
--mark-as-fuzzy: Mark all new translations as fuzzy, usefull when you know you’ll have to proofread the translations.
Propagating known translations
In big projects, there may be multiple occurrences of the same string in different .po files, to automatically fill blanks with already translated ones, use:
pomerge --no-overwrite --from **/*.po --to **/*.po
The --no-overwrite is usefull if the same msgstr has already been translated twice, but differently (depending on the context maybe), the --no-overwrite will prevent one to be overwritten by the other.
Synchronizing translation between git branches
If you’re having multiple branches of your documentation to track multiple branches of your project, you may want to synchronize known translations between branches, you can do it like this:
git checkout master # The place where your contributors work pomerge --from **/*.po # Make pomerge "learn" this set of translations git checkout old_version # The translation for an old branch pomerge --to **/*.po
This way you can still make old translation progress a bit while focusing only on the current master.
Metadata
Release files for pomerge 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pomerge-0.1.3.tar.gz | 4.3 kB | Without provenance | Details for pomerge-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pomerge-0.1.3-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for pomerge-0.1.3-py2.py3-none-any.whl |
Total release size: 8.7 kB
Release files / pomerge-0.1.3.tar.gz
| Download URL | pomerge-0.1.3.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c1399a322c4bace3afe067cc621b7e6f7b997574593fb1b6a91844fcd26992a
|
|
BLAKE2b-256 checksum How to use checksums |
5ceff23ef1877d425d1385e08462b5954da55828b73970c00013ec15bf18b611
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.19.2 CPython/3.7.3rc1
|
Release files / pomerge-0.1.3-py2.py3-none-any.whl
| Download URL | pomerge-0.1.3-py2.py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
35e3f6c64a7a409b25b2bf3060bfb669aea09bb25d8b3a573fceec0973b0f60c
|
|
BLAKE2b-256 checksum How to use checksums |
77b1e963b5a5f4b4af526b098621baa424fc3077daa67d5188c59ff276d0439c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.19.2 CPython/3.7.3rc1
|
Security for pomerge 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.