diff --git a/Dockerfile b/Dockerfile index be7e98ce8da..12497e6543a 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