Msgfmt build hook, replacing all po with mo in build
Project description
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.
Depends on the locales
and destinations
plugin config parameters,
specifying where the source locale files and destination compiled locale files
should be found.
Copyright
This plugin is Copyright 2023 Absolute Performance, Inc.
MIT licensed.
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
Hashes for hatch_msgfmt-1.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6f2996a9a122002f1a69304ac23e45db8b695371470f2d0b854a0ea962c5f6f |
|
MD5 | d264e7ec6cb33911028006548debda0c |
|
BLAKE2b-256 | c821a9b8fde440c8246b5553b41435b40f9f968dbe652c280fbe5ff362c083e8 |