You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/07/02 00:10:42 UTC
(superset) 01/01: fix(i18n): compile fuzzy translations into the backend .mo files
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch fix/i18n-serve-fuzzy-backend
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 7756ca84da3482370896c5e377e9412a4b21d7f8
Author: Amin Ghadersohi <am...@gmail.com>
AuthorDate: Wed Jul 1 17:10:27 2026 -0700
fix(i18n): compile fuzzy translations into the backend .mo files
The main Dockerfile compiled backend translations with a bare `pybabel compile`,
which omits `#, fuzzy` entries — so fuzzy (machine-generated and other draft)
translations fell back to English on the backend. This was inconsistent with
every other translation build path in the repo:
- the frontend build (`po2json --fuzzy`) includes fuzzy entries;
- `flask fab babel-compile` (used by the RELEASING images and
scripts/translations/generate_mo_files.sh) runs `pybabel compile -f`.
Add `--use-fuzzy` to the Dockerfile's `pybabel compile` so the production image
serves fuzzy translations consistently with the frontend and the other backend
build paths. This makes the AI backfill effort (and any other draft
translations) visible in the UI rather than falling back to English while they
await native-speaker review. Docs updated to match.
Co-Authored-By: Claude Opus 4.8 <no...@anthropic.com>
---
Dockerfile | 2 +-
docs/developer_docs/contributing/howtos.md | 17 +++++++++++++++--
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index ecdbb97c751..14d409e0207 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -141,7 +141,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
COPY superset/translations/ /app/translations_mo/
RUN if [ "${BUILD_TRANSLATIONS}" = "true" ]; then \
- pybabel compile -d /app/translations_mo | true; \
+ pybabel compile --use-fuzzy -d /app/translations_mo | true; \
fi; \
rm -f /app/translations_mo/*/*/*.[po,json]
diff --git a/docs/developer_docs/contributing/howtos.md b/docs/developer_docs/contributing/howtos.md
index 405a6311c35..452f705ae57 100644
--- a/docs/developer_docs/contributing/howtos.md
+++ b/docs/developer_docs/contributing/howtos.md
@@ -332,15 +332,28 @@ cd superset-frontend
npm run build-translation
# Backend
-pybabel compile -d superset/translations
+pybabel compile --use-fuzzy -d superset/translations
```
+`--use-fuzzy` includes `#, fuzzy` entries in the compiled `.mo` files. Superset
+serves fuzzy translations on purpose: the frontend build (`po2json --fuzzy`)
+already includes them, `flask fab babel-compile` (used by the release images)
+compiles with `-f`, and the production `Dockerfile` compiles with `--use-fuzzy`
+as well. This keeps machine-generated (and other draft) translations visible in
+the UI rather than falling back to English while they await review.
+
### Backfilling missing translations with AI
For languages with many untranslated strings, the repo includes a script that
uses Claude AI to generate draft translations for any missing entries. All
AI-generated strings are marked `#, fuzzy` and tagged with an attribution
-comment so that human reviewers know they need to be checked before merging.
+comment so that human reviewers know they need to be checked.
+
+Note that `#, fuzzy` marks a translation as *needing review*, not as *withheld*:
+both the frontend and backend builds serve fuzzy entries (see [Applying
+translations](#applying-translations) above), so an AI-generated string is shown
+in the UI as soon as it is built and deployed. Reviewers should verify each
+entry and remove the `#, fuzzy` flag to promote it to a confirmed translation.
#### Prerequisites