l11
Command-line tool to localize free software.
Installation
Install with uv:
uv tool install l11-l10n
The distribution is named l11-l10n and the command is l11. Then run the l11 command:
l11
You can also run l11 without installing it. Name the command too:
uvx --from l11-l10n l11
Usage
Create an empty folder to keep your localization files, enter that folder from a terminal, and run:
l11 init
Add a project and a language:
l11 add <project> [<language code> [<output project file path>]]
For example, to set up KDE translations:
l11 add kde
Add a local ponte bridge repository for machine translation with:
l11 add bridge <path>
Then run l11 open to start work, or pass a project, language, or project file path:
l11 open [<project> [<language>] | <path>]
The most useful commands afterwards are:
l11 open # Open a Lokalize project
l11 list # List the resources of the project
l11 pull # Get the latest translation updates
l11 check # Check the modified translations with Pology
l11 diff # Review the pending changes message by message
l11 overrides # See translations that the ponte bridge would render differently
l11 push # Send translation updates to the remote repositories
l11 status # Show the Git status of each resource
l11 diff runs Pology’s poediff on each translation and bridge repository, so you see a message-level diff of the pending changes, including catalogs that are not in Git yet.
l11 overrides runs ponte overrides --diff with the bridge and translation catalogs, so you see the human translations that the bridge would render differently.
Checks
l11 check runs Pology on the translation files that are fully translated and have uncommitted changes in their Git repository. Pass --all to check every fully translated file instead.
Each check (rules, spelling and grammar) runs the matching Pology sieve on all the selected files, and opens the messages with problems in a running Lokalize instance.
To configure the parameters of each check, add a checks object to .l11/config.json that maps the checks to run to their Pology parameters, without the leading -s:
{
"checks": {
"rules": ["env:kde,docs,game", "rulerx:^rag-*"],
"spelling": ["lang:gl", "accel:&", "skip:\\w+_\\w+"],
"grammar": ["lang:gl", "disable:RULE_1,RULE_2"]
}
}
Only the listed checks run. Without a checks object, all three checks run with Pology’s default parameters.
Search and replace
l11 replace searches messages with a regular expression and previews the changes by default:
l11 replace [--field FIELD]... [--write] REGEX REPLACEMENT [RESOURCE]
For example, to preview a change in translations:
l11 replace '\bcolour\b' 'color'
Pass --write to apply the changes. Without it, l11 runs Pology without writing any catalog, and only prints the fields that would change.
By default the command changes msgid (including plural forms), msgstr (all plural forms) and notes (translator comments, #). Use --field one or more times to restrict the fields, for example --field msgstr --field notes.
Both the regular expression and the replacement use Python’s re module syntax, including inline flags such as (?i) and group backreferences such as \1. Matching is case-sensitive by default. Quote both arguments with single quotes to keep the shell from expanding them:
l11 replace --field msgstr --write \
'(\b[Ss]ave\s+)file(s?)\b' '\1document\2'
Messages used for keywords are skipped: those whose context matches \b(X-KDE-)?Keywords\b and those whose comments or source references match ([^,]+,)*\s*keywords\s*(,|$)|\.rst:1\b. Obsolete messages are skipped too.
Pulling
When a resource has the KDE summit scripts, l11 pull merges the summit catalogs for messages and documentation messages into the translation catalogs. When the project also has a bridge resource, it merges the bridge language first, then the translation language, and only after both merges succeed does it run ponte derive from the bridge catalogs to the translation catalogs. When every merge succeeds, it then runs Pology’s unfuzzy-context-only sieve on the merged catalogs, so that messages whose only change is their context stop being fuzzy. Messages that share their msgid with another message are left fuzzy, because the right translation is ambiguous. The sieve does not add Pology’s unreviewed-context translator comment, because the translation itself did not change. It uses the same fine wrapping as the summit merge, so pulling again without new changes leaves the catalogs untouched. A failed merge skips the sieve, and a failed sieve is reported along with the other pull failures.
Environments
l11 pull can assign translation environments, as described in Pology’s documentation on language environments, based on catalog paths. Pology then uses them to apply environment-specific rules.
Environment names and the paths that select them are project-specific. To configure them, add an environments object to .l11/config.json that maps each environment name to the regular expressions that select its catalogs:
{
"environments": {
"first": ["/messages/first/"],
"second": ["/messages/second/", "\\.\\d+\\.po$"]
}
}
Regular expressions are matched against the catalog path relative to the PO folder, with a leading slash (for example, /messages/first/example.po). A catalog can belong to several environments, and all matching environments are applied. Only catalogs whose environment changes are rewritten, so pulling repeatedly does not create changes to push.
Project requirements
A project can require a minimum l11 version by setting minimum_l11_version in its .l11/config.json file. Older versions of l11 refuse to run on such a project and tell the user how to upgrade.
Supported projects
Transifex is not supported.
Python API
l11 does not have a public Python API. Its modules are internal and may change without notice.
Contributing
To run tests:
uv run tox
Localization
PO files are in the po folder.
To generate a PO file for a new language, install Babel and run:
pybabel extract l11 "$(python -c 'import argparse; print(argparse.__file__)')" -o po/LANG.po
Replace LANG with your actual language code in the command above, or rename the generated file accordingly. The argparse module is extracted from the running interpreter so that the parser’s own messages are translated too.
Metadata
Release files for l11-l10n 0.1.0
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 |
|---|---|---|---|---|
| l11_l10n-0.1.0.tar.gz | 62.3 kB | Without provenance | Details for l11_l10n-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| l11_l10n-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for l11_l10n-0.1.0-py3-none-any.whl |
Total release size: 109.6 kB
Release files / l11_l10n-0.1.0.tar.gz
| Download URL | l11_l10n-0.1.0.tar.gz |
|---|---|
| Size | 62.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
613aa35e12091a6e2c81032fe5e8cc8d0dc795b1b015f2af7ac20a3c9b5abd31
|
|
BLAKE2b-256 checksum How to use checksums |
487e221c63af441891f4d97b21b96bd02b5e1b3de628c97f12f477281f7d3f59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / l11_l10n-0.1.0-py3-none-any.whl
| Download URL | l11_l10n-0.1.0-py3-none-any.whl |
|---|---|
| Size | 47.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60d66e944829068b9a25ca7731986f2134005411038d9f65d8fd6aa80a7f05fa
|
|
BLAKE2b-256 checksum How to use checksums |
b78886731b6e287354d093601dc4cab17a2a3263bac246897212470c2d337d13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for l11-l10n 0.1.0
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.