Superset Translator ITA
A command line tool that machine translates the untranslated strings of Apache Superset's Italian catalog while protecting technical terms, used as a first pass before human review.
- Role
- Author
- When
- March 2026 to May 2026
- Stack
- Python, polib, pytest, Ruff, mypy
Context
Apache Superset keeps its interface strings in gettext .po catalogs, one per language. The Italian catalog had many entries that were missing or marked fuzzy (a guess that still needs checking). Translating them by hand from scratch is slow, but pure machine translation breaks technical terms and format placeholders, and a broken placeholder can crash the interface at runtime.
What I built
A small Python package with a command line entry point:
- It reads a
.pofile, finds every entry that is untranslated or flaggedfuzzy, and translates it from English to Italian, handling singular and plural forms separately. - Before sending a string out, it replaces technical terms (
API,SQL,JWT,OAuthand others) with placeholders and puts them back afterwards, so they are never translated. - It removes the
fuzzyflag from entries it translates and writes a new file, leaving the original untouched. - Requests are rate limited, because it uses Google Translate's free, unofficial endpoint, which throttles large batches.
The code is split into PO orchestration, term protection and the HTTP client, each with its own tests, and CI runs Ruff, mypy and pytest.
Related work
The tool targets the same catalog as my Italian translation pull requests to Apache Superset, three of which were merged; the last one brought the catalog to zero untranslated and zero fuzzy entries, with every placeholder checked. See the Apache Superset page for details.
Limitations
The free endpoint has no service guarantee and can block heavy use; a full catalog takes around ten minutes at the built in request rate. Machine output always needs a human pass before it reaches users.