pybabel-angularjs
A Babel message extractor for AngularJS HTML
templates. It extracts element content and attributes marked for translation,
including strings containing AngularJS expressions such as {{ name }}.
Requires Python 3.12 or newer.
Installation
python -m pip install pybabel-angularjs
The package installs the angularjs Babel extractor entry point. Add it to a
Babel mapping file such as babel.cfg:
[angularjs: **/*.html]
encoding = utf-8
Then extract messages in the usual way:
pybabel extract -F babel.cfg -o messages.pot .
Marking messages
Mark an element's content with i18n:
<div i18n>Hello world!</div>
<p i18n>Hello {{ name }}!</p>
The value of i18n, when present, is included as a comment for translators:
<h1 i18n="Page heading">Welcome</h1>
Mark an individual attribute by adding the i18n- prefix:
<input placeholder="Your name" i18n-placeholder>
Configuration
Options are set in the extractor section of the Babel mapping file. Lists can be separated by commas or whitespace.
[angularjs: **/*.html]
encoding = utf-8
include_tags = h1, h2, p
include_attributes = title, alt, placeholder
allowed_tags = a, strong, br, i
allowed_attributes_a = href, target
include_format_flags = false
extract_attributechanges the marker from the defaulti18n, for example todata-translate.include_tagsextracts all content from the listed tags without requiring an explicit marker.include_attributesextracts the listed attributes wherever they occur.allowed_tagscontrols which nested HTML tags may appear inside a translated message. The default isstrong, br, i.allowed_attributes_<tag>controls attributes allowed on a nested tag, for exampleallowed_attributes_a = href, target.encodingcontrols template decoding and defaults toutf-8.include_format_flagsmakes the extractor return an extended five-value result and marks messages containing AngularJS interpolation withangularjs-format. It defaults tofalsebecause official Babel releases accept only the standard four-value extractor result. Enable it only with a Babel build that explicitly supports extractor-provided flags.
Use no-i18n to exclude an automatically included tag. A <div no-i18n>
excludes its entire subtree. For automatically included attributes, use the
corresponding marker such as no-i18n-title.
License
Apache License 2.0. The project was heavily inspired by the original shoreware/pybabel-angularjs.
Metadata
Release files for pybabel-angularjs 1.5.1
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 |
|---|---|---|---|---|
| pybabel_angularjs-1.5.1.tar.gz | 9.9 kB | With provenance | Details for pybabel_angularjs-1.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pybabel_angularjs-1.5.1-py3-none-any.whl | Python 3 | none | any | Details for pybabel_angularjs-1.5.1-py3-none-any.whl |
Total release size: 20.0 kB
Release files / pybabel_angularjs-1.5.1.tar.gz
| Download URL | pybabel_angularjs-1.5.1.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8851cd66060722667d068352fe44a55161e8165f65617329bd78dd64da1e3da1
|
|
BLAKE2b-256 checksum How to use checksums |
d76eaf203671e8ca3ab9491e4635a6e060487102b89f413e8a486b8e2f529d75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.
Transparency logRelease files / pybabel_angularjs-1.5.1-py3-none-any.whl
| Download URL | pybabel_angularjs-1.5.1-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eb3210d8b4267d33fb09de6719e3e40cc64ac8294576109b9bc08ca9174d7780
|
|
BLAKE2b-256 checksum How to use checksums |
8478627264bdec9c3a07c262db340223ad39e0aa5edcb87e1bc6c944e4f7304a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.
Transparency logSecurity for pybabel-angularjs 1.5.1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pybabel_angularjs-1.5.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.
Transparency logA 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.