compare-locales
Lint Mozilla localizations
What it is and what it does
compare-locales is a command-line linter and merge tool for Mozilla localization workflows. It validates localization files against a reference (typically English) to detect missing strings, obsolete entries, and runtime errors without false positives, while also warning on potential issues. The package includes two main tools: compare-locales for validating locales across a project, and moz-l10n-lint for checking local work and detecting string conflicts.
The tool is configured via an l10n.toml project file and works with Mozilla's localization structure. It can merge localizations by padding them with missing English strings and replacing error-prone entities with English fallbacks, making it essential for maintaining consistency across multiple language variants in large projects.
Use it for:
- Validate all locales in a Mozilla project against a reference configuration to catch missing or obsolete strings before release.
- Lint local localization work before committing to detect errors and conflicts in string definitions.
- Merge localizations with English fallbacks to ensure no untranslated strings break the application at runtime.
- Check for conflicts between locally-defined strings and those already exposed to the l10n community.
- Integrate into CI/CD pipelines to enforce localization quality standards across monolithic and gecko-based projects.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Lints Mozilla localization files to find missing, obsolete, and erroneous strings; also merges localizations with English fallbacks and checks for conflicts in string definitions.
Yes, if you maintain Mozilla localizations or similar multi-language projects. The tool is actively maintained, has no known vulnerabilities, and low install friction. The copyleft license is standard for Mozilla tooling; verify it aligns with your project's licensing model before use.
Install
compare-locales on PyPI
pip
pip install compare-localesuv
uv add compare-localespoetry
poetry add compare-localesInstalling compare-locales
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained as of May 2026, with recent commits and production-stable status.
License in practice
Mozilla Public License 2.0 (copyleft) requires that modifications and derivative works remain under MPL-2.0; suitable for internal tooling and open-source projects but check your licensing requirements if distributing modified versions.
Quickstart
pip install compare-locales
compare-locales l10n.toml .
moz-l10n-lint l10n.toml
Requires an l10n.toml configuration file in your project; see moz-l10n-config documentation for format details.
Verify before relying
- Whether fluent.syntax, six, and toml are bundled or require separate installation in your environment.
- Performance characteristics when linting large localization projects with many locales.
Package facts
| License | MPL-2.0 (copyleft) |
| Python support | supports the current Python release (<4,>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — fluent.syntax, six, toml |
| Maintenance | actively maintained — 76 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 81,727/month — #14,206 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: compare_locales-9.0.5-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
mozilla-versionParse and validate Mozilla product version…
copyleft · top 15,000 on PyPI
translation-finderDiscovers and identifies translation files in…
copyleft · top 15,000 on PyPI
babelBabel provides internationalization (i18n) and…
permissive · top 1,000 on PyPI
weblate-language-dataProvides language definitions, plural rules,…
permissive · top 15,000 on PyPI
ResourceBundleResourceBundle manages internationalization and…
permissive · top 15,000 on PyPI
translationstringProvides translation string objects and…
permissive · top 5,000 on PyPI
mozversionExtracts and reports version information from…
copyleft · top 15,000 on PyPI
flask-babelAdds internationalization (i18n) and…
permissive · top 5,000 on PyPI
quart_babelAdds internationalization (i18n) and…
permissive · top 15,000 on PyPI