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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fabricatio_locale-0.1.9-cp314-cp314-win_amd64.whl (409.4 kB view details)

Uploaded CPython 3.14Windows x86-64

fabricatio_locale-0.1.9-cp314-cp314-manylinux_2_34_x86_64.whl (530.4 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

fabricatio_locale-0.1.9-cp314-cp314-manylinux_2_34_aarch64.whl (489.3 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ ARM64

fabricatio_locale-0.1.9-cp314-cp314-macosx_11_0_arm64.whl (470.3 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

fabricatio_locale-0.1.9-cp313-cp313-win_amd64.whl (410.0 kB view details)

Uploaded CPython 3.13Windows x86-64

fabricatio_locale-0.1.9-cp313-cp313-manylinux_2_34_x86_64.whl (530.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

fabricatio_locale-0.1.9-cp313-cp313-manylinux_2_34_aarch64.whl (489.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

fabricatio_locale-0.1.9-cp313-cp313-macosx_11_0_arm64.whl (469.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fabricatio_locale-0.1.9-cp312-cp312-win_amd64.whl (410.1 kB view details)

Uploaded CPython 3.12Windows x86-64

fabricatio_locale-0.1.9-cp312-cp312-manylinux_2_34_x86_64.whl (530.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

fabricatio_locale-0.1.9-cp312-cp312-manylinux_2_34_aarch64.whl (489.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

fabricatio_locale-0.1.9-cp312-cp312-macosx_11_0_arm64.whl (469.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file fabricatio_locale-0.1.9-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: fabricatio_locale-0.1.9-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 409.4 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

File hashes

Hashes for fabricatio_locale-0.1.9-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 11ece4f52ef2b4843bf41dc6c4b6556a50def5479af9cba46933e8d808fa2b10
MD5 1e646dda87db4f6c5ccfb42735cabfff
BLAKE2b-256 63759b5ebdcf2ae0b06ef956c529c3817a3e7a2ac4a7dc487f6e7f0110acc563

See more details on using hashes here.

File details

Details for the file fabricatio_locale-0.1.9-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_locale-0.1.9-cp314-cp314-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 530.4 kB
  • Tags: CPython 3.14, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

File hashes

Hashes for fabricatio_locale-0.1.9-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f229effb1c218b558cfc898deb45128e7605ecb992667ff89ec8b463c6102da6
MD5 10ecb39c1c5e095cdd112790b97605e7
BLAKE2b-256 fbf030ec725b87b718aadf1ce9cce88c095381afa6df40abb4868743a0959fd5

See more details on using hashes here.

File details

Details for the file fabricatio_locale-0.1.9-cp314-cp314-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_locale-0.1.9-cp314-cp314-manylinux_2_34_aarch64.whl
  • Upload date:
  • Size: 489.3 kB
  • Tags: CPython 3.14, manylinux: glibc 2.34+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

File hashes

Hashes for fabricatio_locale-0.1.9-cp314-cp314-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 458658fa325d3f0b395b492b33ee6c80fc62cadf58f86214b6511b384b8d63f2
MD5 6167ea78e52856f836aba8362c9167a0
BLAKE2b-256 87745ab257479992de679b11d55c6b2fa555e07374a8cdfa612c3094b8f6be75

See more details on using hashes here.

File details

Details for the file fabricatio_locale-0.1.9-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_locale-0.1.9-cp314-cp314-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 470.3 kB
  • Tags: CPython 3.14, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

File hashes

Hashes for fabricatio_locale-0.1.9-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c7ec85ef446fde1ec85b194a4296fee14fa8171aa5865972e178dd8869a48433
MD5 731c183334524a105ccc6fe653b14b5b
BLAKE2b-256 0da1c9ad947151621d6e62799beac5107bb510cd4f5e82e50454128b8c9e9880

See more details on using hashes here.

File details

Details for the file fabricatio_locale-0.1.9-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: fabricatio_locale-0.1.9-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 410.0 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

File hashes

Hashes for fabricatio_locale-0.1.9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9bec76d75bbab5a38098bd69c4299927be04481a20bef95e2d8b1165f1e8d1fe
MD5 57d6671b685fb1f46b317f7af60c0d58
BLAKE2b-256 d72134a42cda31006054819a26f14ba940b64b618281096d643651232c5e9dc1

See more details on using hashes here.

File details

Details for the file fabricatio_locale-0.1.9-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_locale-0.1.9-cp313-cp313-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 530.5 kB
  • Tags: CPython 3.13, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

File hashes

Hashes for fabricatio_locale-0.1.9-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 40fe872340362869a0256354136b63746d4d0aa98160b4190dc5438e08563f5d
MD5 d080ad9a26f8a971bcb9755d26e995a9
BLAKE2b-256 76316eec9048d4fd3aba737e49cab029b08eb51cecf07b6048e17981349997ea

See more details on using hashes here.

File details

Details for the file fabricatio_locale-0.1.9-cp313-cp313-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_locale-0.1.9-cp313-cp313-manylinux_2_34_aarch64.whl
  • Upload date:
  • Size: 489.4 kB
  • Tags: CPython 3.13, manylinux: glibc 2.34+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

File hashes

Hashes for fabricatio_locale-0.1.9-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 e7ceac089c3d3f646d916287b5ebcd0028ccaaba9ae050f879b1af2960ed6d9d
MD5 638d83e9fd6600f29f3be4fbaae49c1d
BLAKE2b-256 1b3fe99c51a76a4585a755e1f4bbf958a276abc76cd82e3d23112e3f83e33f6c

See more details on using hashes here.

File details

Details for the file fabricatio_locale-0.1.9-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_locale-0.1.9-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 469.7 kB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

File hashes

Hashes for fabricatio_locale-0.1.9-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1fcc84ffa6860f0731c89530134c15b55bc0659fab22cd4704a3d4650ff15e40
MD5 a94e11049cac7a380e399fa58ffedc2b
BLAKE2b-256 6f2e90f338b9f802b2e68e65da67b6bf0ea81a18407def6d50f1b802af150ccf

See more details on using hashes here.

File details

Details for the file fabricatio_locale-0.1.9-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: fabricatio_locale-0.1.9-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 410.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

File hashes

Hashes for fabricatio_locale-0.1.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 74f8a0d1d669c903df175fc5f958df266f614a4bf630d8b158e8b005303a5d4c
MD5 1cf21262840c55b6d6c2a5214d1c2a36
BLAKE2b-256 b669b3b4de5bff035476ffcd694f2941ca74ec14e44f0066ad666a2e66d61515

See more details on using hashes here.

File details

Details for the file fabricatio_locale-0.1.9-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_locale-0.1.9-cp312-cp312-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 530.8 kB
  • Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

File hashes

Hashes for fabricatio_locale-0.1.9-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d4426b536a305869536c5658bdb19fec74d7bf783b8162596783cc4b833ca3ce
MD5 308caad314ea79975f865403fb37f263
BLAKE2b-256 d67ae40f5987fdd987d7e96722ce3b4900362939179330a4ecce7ebf9ed166a4

See more details on using hashes here.

File details

Details for the file fabricatio_locale-0.1.9-cp312-cp312-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_locale-0.1.9-cp312-cp312-manylinux_2_34_aarch64.whl
  • Upload date:
  • Size: 489.7 kB
  • Tags: CPython 3.12, manylinux: glibc 2.34+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

File hashes

Hashes for fabricatio_locale-0.1.9-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 dd5e905429bbf3b3e82ece93a8edcc45352c3a362a3b99f875664f5927a7018a
MD5 100d348bfbdc70a593a33f08dc26ebd3
BLAKE2b-256 346bfc317f9e8a28c69e452fd5b2c71391fedc18e60aa1ccb40c0d0ab90d7c6f

See more details on using hashes here.

File details

Details for the file fabricatio_locale-0.1.9-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_locale-0.1.9-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 469.6 kB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

File hashes

Hashes for fabricatio_locale-0.1.9-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 16e4e2d74a5d0b34dcf9fc9cf5cb998503553517369b7f8cbce169168ee0e7b6
MD5 a2c48aca8b7811e5be60cf48316d61a9
BLAKE2b-256 2e8fdc9a54b628cde82c73cc1562677cb4709a25726a0e83e83c1afb803d7e8d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.9 This release

12 files

0.1.8

12 files

0.1.7

12 files

0.1.6

12 files

0.1.5

12 files

0.1.4

12 files

0.1.3

8 files

0.1.1

8 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page