Skip to main content

hatch-msgfmt

A hatch msgfmt plugin, simply replacing all po files with mo files, using msgfmt in PATH.

At a future point, a pure-python version could be implemented, by implementing a pure-Python version of msgfmt. [The standard cpython msgfmt.py](https:// github.com/python/cpython/blob/main/Tools/i18n/msgfmt.py) could be a starting point for this, but it's not as capable as GNU Gettext, and doesn't support plural forms. Even with a fresh implementation, handling the file encoding from the header is challenging, especially for variable-length encodings like EUC-JP, which could feasibly cause particular problems.

Better to just use the system one for now. If somebody wants to submit a pure- python implementation that functions, I'll gladly integrate it as a separate msgfmtpy plugin in the same repository.

Config parameters

  • locales: The location of the source .po files.

  • destination: The location of the destination .mo files. They will be put into this location in the same structure as the source tree relative to the locales path.

  • pathsub_regex (optional): An input regex to match against source files for name changes.

  • pathsub_replace (required if pathsub_regex is present): An replacement pattern to use for name changes.

Copyright

This plugin is Copyright 2023 Absolute Performance, Inc. with contributions by Adrián Chaves.

MIT licensed.

Release files for hatch-msgfmt 1.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hatch-msgfmt 1.1.6
File Size Uploaded
hatch-msgfmt-1.1.6.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hatch-msgfmt 1.1.6
File Interpreter ABI Platform
hatch_msgfmt-1.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 9.4 kB

Release files / hatch-msgfmt-1.1.6.tar.gz

Download URL hatch-msgfmt-1.1.6.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
120ddeb7014adb776a7b1f35b2ce9e8b76da8a146804187ced933110231ed878
BLAKE2b-256 checksum
How to use checksums
6b9bc6019e612449a0c8da5b896d942894a8dafdad32587e46487842925432d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1

Release files / hatch_msgfmt-1.1.6-py3-none-any.whl

Download URL hatch_msgfmt-1.1.6-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a0e29a0fb6aa64433e672ebd0280c946e990d4363d00576f26fabfa0c0756d1
BLAKE2b-256 checksum
How to use checksums
d7f928b9c39ffe0c7db2caba9318af3c134a9b5308e6ff86aeb658431257038e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page