Skip to main content

Linter for localization files (.po, .ts)

Project description

l10n-lint

Version License Python

Description

A comprehensive linter for localization files (.po, .ts). Finds missing translations, placeholder mismatches, terminology errors, and 20+ other common issues.

Built with Python as part of the professional L10n Tool Suite, l10n-lint provides essential quality assurance for translation projects, helping maintain consistency and accuracy across multilingual applications.

Features

  • 23 built-in checks covering placeholders, formatting, terminology, consistency, and more
  • Swedish terminology validation — catches common translation mistakes (e.g., "redaktör" → "redigerare")
  • Domain-specific rules — music, web platform, and mail terminology
  • False friends detection — flags Swedish–English false cognates
  • Consistency checking — ensures the same source term gets the same translation
  • Multiple output formats — text, JSON, HTML, GNU (Emacs-compatible), GitHub Actions
  • GTK4 GUI — graphical interface for desktop use
  • GitHub integration — lint repositories directly via --github owner/repo
  • Custom glossaries — load your own term lists via --glossary
  • CI-friendly--check mode with exit codes, --quiet for summaries

Installation

APT (Debian/Ubuntu)

echo "deb https://yeager.github.io/debian-repo stable main" | sudo tee /etc/apt/sources.list.d/yeager-l10n.list
curl -fsSL https://yeager.github.io/debian-repo/yeager-l10n.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/yeager-l10n.gpg
sudo apt update && sudo apt install l10n-lint

DNF (Fedora)

sudo dnf config-manager --add-repo https://yeager.github.io/rpm-repo/yeager-l10n.repo
sudo dnf install l10n-lint

pip

pip install l10n-lint

Building from source

git clone https://github.com/yeager/l10n-lint
cd l10n-lint
pip install -e .

Usage

Basic usage:

# Lint a single file
l10n-lint translations/sv.po

# Lint a directory recursively
l10n-lint ./po/

# Lint a GitHub repository
l10n-lint --github yeager/l10n-lint

Advanced options:

# Generate HTML report
l10n-lint -f html -o report.html ./translations/

# JSON output for CI pipelines
l10n-lint -f json -o results.json .

# Run only specific checks
l10n-lint --checks terminology,false-friends,consistency sv.po

# CI mode (exit code only)
l10n-lint --check --strict .

See the manual for complete options:

man l10n-lint
l10n-lint --help

Checks Available

# Check Description
1 placeholders Format string mismatches (%s, %d, {0}, etc.)
2 length Translations significantly longer/shorter than source
3 punctuation Trailing punctuation differences
4 capitalization Leading capitalization mismatches
5 whitespace Leading/trailing whitespace, double spaces
6 quotes Quote style consistency
7 html-tags HTML tag mismatches between source and translation
8 escapes Escape sequence mismatches (\n, \t, etc.)
9 accelerators Keyboard accelerator (&, _) mismatches
10 numerics Number changes between source and translation
11 untranslated Empty or fuzzy translations
12 repeated-words Repeated consecutive words
13 source-equals-translation Translation identical to source (smart filtering)
14 option-values CLI option/flag consistency
15 number-localization Number format localization
16 currency-localization Currency format issues
17 date-format Date format localization
18 newline-mismatch Newline count differences
19 python-format Python-style format string validation
20 terminology Swedish term consistency
21 domain-terminology Domain-specific terms — music, web, mail
22 false-friends Swedish–English false cognates
23 consistency Same source → same translation within a file

Output Formats

Format Flag Use case
text -f text Terminal output (default)
json -f json CI pipelines, integrations
html -f html Shareable reports
gnu -f gnu Emacs compile-mode compatible
github -f github GitHub Actions annotations

Translation

Translations are managed on Transifex: https://app.transifex.com/danielnylander/l10n-lint/

Currently supported: Swedish, Danish, German, Spanish, Finnish, French, Italian, Norwegian Bokmål, Dutch, Polish, Portuguese (Brazil)

Contributions welcome!

Changelog

  • 1.19.0: Latest stable release with enhanced check accuracy
  • 1.17.0: Added terminology intelligence, domain-specific rules, false friends detection
  • 1.16.0: 76% reduction in false positives (26,576 → 6,308 issues)
  • 1.15.x: GTK4 GUI, GitHub integration, custom glossaries
  • 1.14.x: Multiple output formats, CI integration

License

GPL-3.0-or-later

Author

Daniel Nylander (daniel@danielnylander.se)

Project details


Download files

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

Source Distribution

l10n_lint-1.20.0.tar.gz (47.1 kB view details)

Uploaded Source

Built Distribution

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

l10n_lint-1.20.0-py3-none-any.whl (45.6 kB view details)

Uploaded Python 3

File details

Details for the file l10n_lint-1.20.0.tar.gz.

File metadata

  • Download URL: l10n_lint-1.20.0.tar.gz
  • Upload date:
  • Size: 47.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for l10n_lint-1.20.0.tar.gz
Algorithm Hash digest
SHA256 820e7a2f17dd9f0d98ebca0d1ae606034a966e0e6bb8be5c69e28ba7363fd0ec
MD5 50d071657fa3c1805ecae51034ca4ce8
BLAKE2b-256 9fc3e23a5893a46b3b42459115c209cd81f79a9d4e28ecc4fde9f8b8acf616d5

See more details on using hashes here.

File details

Details for the file l10n_lint-1.20.0-py3-none-any.whl.

File metadata

  • Download URL: l10n_lint-1.20.0-py3-none-any.whl
  • Upload date:
  • Size: 45.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for l10n_lint-1.20.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65524eb12eb1aaf2e36073af236ab6c6880983244077a249ca8ed0df91ff5811
MD5 508f2727ff72f75425fcf44a9fce1312
BLAKE2b-256 dd818dc04f148aba5eefee59e1ab55585f5c6fb766e3bf23fb6c4087dd55bb78

See more details on using hashes here.

Supported by

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