Skip to main content

fabricatio-locale

MIT License Python Versions PyPI Version PyPI Downloads PyPI Downloads Bindings: PyO3 Build Tool: uv

Localization extension for Fabricatio. Reads, translates, and writes gettext .po files using LLM-powered translation.


Installation

pip install fabricatio[locale]
# or
uv pip install fabricatio[locale]

Overview

fabricatio-locale automates .po file localization by combining Rust-backed PO file I/O with Fabricatio's translation pipeline. It parses standard gettext .po files, translates message strings to a target language via fabricatio-translate, and writes the localized file back — preserving message IDs, metadata, and file structure.

API

Rust-backed (PyO3)

| Symbol | Description | :|---|---| | Msg(id, txt) | Immutable message object: id is the msgid, txt is the translated msgstr. | | read_pofile(path) | Parses a .po file and returns list[Msg]. | | update_pofile(path, messages) | Writes a sequence of Msg back to a .po file. |

These are available as from fabricatio_locale.rust import Msg, read_pofile, update_pofile.

Capability

| Class | Description | :|---|---| | Localize | Extends Translate. Provides async localize(msgs: list[Msg], **kwargs) -> list[Msg] — translates message texts while preserving IDs. |

Action

| Class | Description | :|---|---| | LocalizePoFile | An executable action combining Localize with PO file I/O. Fields: pofile (source path), target_lang (language code), output_path (defaults to overwriting input). Calling execute() reads, localizes, and writes the file. |

Configuration

All options below are read through the fabricatio configuration chain (see the Configuration Guide). Set them under the [ext.locale] table in fabricatio.toml, equivalently under [tool.fabricatio.ext.locale] in pyproject.toml, or via FABRICATIO_EXT__LOCALE__<FIELD_UPPER> environment variables.

[ext.locale]

The schema currently defines no options and is reserved for future use.

Access at runtime: from fabricatio_locale.config import locale_config.

Usage

from fabricatio_locale.rust import Msg, read_pofile, update_pofile

# Read a PO file
messages = read_pofile("locales/en.po")
for msg in messages:
    print(f"msgid={msg.id} msgstr={msg.txt}")

# Modify and write back
updated = [Msg(id=m.id, txt="translated text") for m in messages]
update_pofile("locales/en.po", updated)
from fabricatio_locale.capabilities.localize import Localize

# Localize messages programmatically
class MyLocalizer(Localize):
    pass

localizer = MyLocalizer()
result = await localizer.localize(
    [Msg(id="hello", txt="Hello")],
    target_language="fr"
)
# result[0].txt -> "Bonjour"
from fabricatio_locale.actions.localize import LocalizePoFile

# End-to-end PO file localization
action = LocalizePoFile(
    pofile="locales/en.po",
    target_lang="es",
    output_path="locales/es.po"
)
output = await action.execute()
# output: Path("locales/es.po")

Dependencies

  • fabricatio-core — core interfaces (Action, configuration)
  • fabricatio-translate — LLM translation pipeline (the Translate capability)
  • polib (Rust) — PO file parsing and writing

License

MIT — see LICENSE

Metadata

Release files for fabricatio-locale 0.1.10

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

Built distributions (wheels)

Table of built distributions (wheels) for fabricatio-locale 0.1.10
File Actions
fabricatio_locale-0.1.10-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for fabricatio_locale-0.1.10-cp314-cp314-win_amd64.whl
fabricatio_locale-0.1.10-cp314-cp314-manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ x86-64 Details for fabricatio_locale-0.1.10-cp314-cp314-manylinux_2_34_x86_64.whl
fabricatio_locale-0.1.10-cp314-cp314-manylinux_2_34_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ ARM64 Details for fabricatio_locale-0.1.10-cp314-cp314-manylinux_2_34_aarch64.whl
fabricatio_locale-0.1.10-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for fabricatio_locale-0.1.10-cp314-cp314-macosx_11_0_arm64.whl
fabricatio_locale-0.1.10-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for fabricatio_locale-0.1.10-cp313-cp313-win_amd64.whl
fabricatio_locale-0.1.10-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details for fabricatio_locale-0.1.10-cp313-cp313-manylinux_2_34_x86_64.whl
fabricatio_locale-0.1.10-cp313-cp313-manylinux_2_34_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ ARM64 Details for fabricatio_locale-0.1.10-cp313-cp313-manylinux_2_34_aarch64.whl
fabricatio_locale-0.1.10-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for fabricatio_locale-0.1.10-cp313-cp313-macosx_11_0_arm64.whl
fabricatio_locale-0.1.10-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for fabricatio_locale-0.1.10-cp312-cp312-win_amd64.whl
fabricatio_locale-0.1.10-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details for fabricatio_locale-0.1.10-cp312-cp312-manylinux_2_34_x86_64.whl
fabricatio_locale-0.1.10-cp312-cp312-manylinux_2_34_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ ARM64 Details for fabricatio_locale-0.1.10-cp312-cp312-manylinux_2_34_aarch64.whl
fabricatio_locale-0.1.10-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for fabricatio_locale-0.1.10-cp312-cp312-macosx_11_0_arm64.whl

Total release size: 5.7 MB

Release files / fabricatio_locale-0.1.10-cp314-cp314-win_amd64.whl

Download URL fabricatio_locale-0.1.10-cp314-cp314-win_amd64.whl
Size 405.8 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
d5cb682cfb5d4427b13f681559615d8c6bfbc344ac9e3fd1d3c7cd47ec9fa8d2
BLAKE2b-256 checksum
How to use checksums
4df0174d6e58f0f430556e25c31f06b76aecc97d0931a28811a0b20d4e232d1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_locale-0.1.10-cp314-cp314-manylinux_2_34_x86_64.whl

Download URL fabricatio_locale-0.1.10-cp314-cp314-manylinux_2_34_x86_64.whl
Size 527.6 kB
Tags CPython 3.14 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
7d054d58da386ee904c9588dc5818014d07d212d0d2b1681f7a624dc7937ea9b
BLAKE2b-256 checksum
How to use checksums
130059559e01ddcb6d519253bc53dafeb3a44e176b45547897650852ebdc4a50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_locale-0.1.10-cp314-cp314-manylinux_2_34_aarch64.whl

Download URL fabricatio_locale-0.1.10-cp314-cp314-manylinux_2_34_aarch64.whl
Size 490.7 kB
Tags CPython 3.14 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
cd862f8f4f3e90c79fa40d67a897b80fa7891d9b2cb3aed5512b420c22c3c382
BLAKE2b-256 checksum
How to use checksums
f5a8a1373e59015d06472c7330443b67165d87391e646aefd1ab9bf459453d56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_locale-0.1.10-cp314-cp314-macosx_11_0_arm64.whl

Download URL fabricatio_locale-0.1.10-cp314-cp314-macosx_11_0_arm64.whl
Size 473.5 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ae2b3dace7bdcecb7a1f41935b9b6656495559e5c1f9859b59c4a8f4d3c5d66e
BLAKE2b-256 checksum
How to use checksums
57d01eea2b9ec406d2fddc75348d4143be254c1c495d368d6f711b89c19e8f51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_locale-0.1.10-cp313-cp313-win_amd64.whl

Download URL fabricatio_locale-0.1.10-cp313-cp313-win_amd64.whl
Size 406.0 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
bf6a39aa55ab1d7f4dba02c8a06ca20b4886c921fc546f72b7150a41bf7e8205
BLAKE2b-256 checksum
How to use checksums
00d3dfb76a7d35ac286c9826c765a4d322ae9ff7b1fdd5f35d2119505cfab25f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_locale-0.1.10-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL fabricatio_locale-0.1.10-cp313-cp313-manylinux_2_34_x86_64.whl
Size 527.2 kB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
2070f1569a72eccef81cb324c11f20086dfe277f0ed183dbd850f74844059298
BLAKE2b-256 checksum
How to use checksums
5661ecc8dfb9901d3bd8d43ffa5c59aa1602cfbf6c1594189d674bdd6e2dea02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_locale-0.1.10-cp313-cp313-manylinux_2_34_aarch64.whl

Download URL fabricatio_locale-0.1.10-cp313-cp313-manylinux_2_34_aarch64.whl
Size 491.2 kB
Tags CPython 3.13 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
7e98a776ff93326e67ce7b2a72d6ee8adfe723bad6f04801d3c7b7dde0e486ab
BLAKE2b-256 checksum
How to use checksums
c4316ca796bd870447bae42cc6cef477e5adcfd7492f67f4e2f5a0b38a1ee965
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_locale-0.1.10-cp313-cp313-macosx_11_0_arm64.whl

Download URL fabricatio_locale-0.1.10-cp313-cp313-macosx_11_0_arm64.whl
Size 473.2 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2e3ff8888094ef9fe87b1ab590f1bb56f0f5b1ff3bbc464605cd8e0988413b37
BLAKE2b-256 checksum
How to use checksums
9fdc66f855a4392aced6cf54028d976b6b553853bcea8e312d8b76865a6958c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_locale-0.1.10-cp312-cp312-win_amd64.whl

Download URL fabricatio_locale-0.1.10-cp312-cp312-win_amd64.whl
Size 406.3 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
b7fd6e9372e59669aa0d0f2c4adc241c27431116ff972b872c89fd91bcea1db8
BLAKE2b-256 checksum
How to use checksums
feaa5157625b03ae07ddc51b79c5c34b74cb1da21ea4ae2365e068af94017585
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_locale-0.1.10-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL fabricatio_locale-0.1.10-cp312-cp312-manylinux_2_34_x86_64.whl
Size 527.7 kB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
87a62942d80be80ef7c21b021373182ab2346f1479de544d7cbc72bb1396e892
BLAKE2b-256 checksum
How to use checksums
3f9f2dcc29cac172388ee722491391842e6e134c0efb78ec772959cc5e163bd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_locale-0.1.10-cp312-cp312-manylinux_2_34_aarch64.whl

Download URL fabricatio_locale-0.1.10-cp312-cp312-manylinux_2_34_aarch64.whl
Size 491.4 kB
Tags CPython 3.12 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
9356cb9b422d8833e2fe7dd7b77805c2f17ff3fcc2ae23d557c93807a65be605
BLAKE2b-256 checksum
How to use checksums
056280f52a05d2794b8578d7021d7ab8cce2524a5aeaee789312807fbd384edf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_locale-0.1.10-cp312-cp312-macosx_11_0_arm64.whl

Download URL fabricatio_locale-0.1.10-cp312-cp312-macosx_11_0_arm64.whl
Size 474.0 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
37d4a56cdfdb0073a6119de7dd1b6d7363009798f8a9d9325084885e49a4f24e
BLAKE2b-256 checksum
How to use checksums
756686d17f92112ee4384f25205dbf38b0fe6818528e52f90dbe343a1959cf8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for fabricatio-locale 0.1.10

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.

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