Repository navigation
fix(i18n): compile fuzzy translations into the backend .mo files - #41648
Conversation
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 <[email protected]>
Code Review Agent Run #24cb17Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The flagged issue is correct. Piping To resolve this, you should remove the pipe to Proposed FixIn RUN if [ "${BUILD_TRANSLATIONS}" = "true" ]; then \
pybabel compile --use-fuzzy -d /app/translations_mo; \
fi; \
rm -f /app/translations_mo/*/*/*.[po,json]There are no other comments in this pull request to address. Dockerfile |
Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Bito Automatic Review Skipped – PR Already Merged |
SUMMARY
The main
Dockerfilecompiled backend translations with a barepybabel compile, which omits#, fuzzyentries — so fuzzy (machine-generated and other draft) translations fell back to English on the backend. This is inconsistent with every other translation build path in the repo:superset-frontend/scripts/po2json.sh) runspo2json --fuzzy, which includes fuzzy entries;flask fab babel-compile— used by the RELEASING images (RELEASING/Dockerfile.from_*_tarball) andscripts/translations/generate_mo_files.sh— runspybabel compile -finternally (seeflask_appbuilder/cli.py).So the production image was the only path dropping fuzzy translations. This PR adds
--use-fuzzyto the Dockerfile'spybabel compile, making the backend serve fuzzy translations consistently with the frontend and the other backend build paths.Motivation: we're running an AI-assisted backfill across the language catalogs (fuzzy-marked, pending native-speaker review — see the de/lv/fi/es/sk/th/uk/cs PRs). With this change, those draft translations (and any other
#, fuzzyentries) are shown in the UI on both frontend and backend rather than falling back to English while awaiting review.#, fuzzyremains the "needs review" marker; reviewers de-fuzz to confirm.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Backend-compiled catalogs (
BUILD_TRANSLATIONS=true):#, fuzzyentries excluded → English fallback in server-rendered strings.#, fuzzyentries included → translated string served (matching the frontend).TESTING INSTRUCTIONS
# fuzzy entry is included with --use-fuzzy, excluded without it pybabel compile --use-fuzzy --statistics -d superset/translationsBuild the image with
--build-arg BUILD_TRANSLATIONS=trueand confirm a#, fuzzybackend string renders translated rather than in English.ADDITIONAL INFORMATION