Bug description

hello, I use this docker file to build my superset container, it's based on the 5.0.0, I need the french translation, but it's not clear at all how to get it.

I tried to build the frontend on my machine starting from the git code, but that doesn't work. I think it's very important to have a well documented procedure to get a specific translation. Moving from 4.1.2 to 5.0.0 it's a big pain, since I've lost the translation and don't know how to get it back

# change this to apache/superset:5.0.0 or whatever version you want to build from;
# otherwise the default is the latest commit on GitHub master branch
FROM apache/superset:5.0.0

USER root

ARG BUILD_TRANSLATIONS=true

# backend
COPY translations/fr/LC_MESSAGES/messages.po /app/superset/translations/fr/LC_MESSAGES/messages.po
# frontend
COPY translations/fr/LC_MESSAGES/messages.json /app/superset/static/assets/i18n/fr.json

# Set environment variable for Playwright
ENV PLAYWRIGHT_BROWSERS_PATH=/usr/local/share/playwright-browsers

# Install packages using uv into the virtual environment
RUN . /app/.venv/bin/activate && \
    uv pip install \
    # install psycopg2 for using PostgreSQL metadata store - could be a MySQL package if using that backend:
    psycopg2-binary \
    # add the driver(s) for your data warehouse(s), in this example we're showing for Microsoft SQL Server:
    pymssql \
    # package needed for using single-sign on authentication:
    Authlib \
    # openpyxl to be able to upload Excel files
    openpyxl \
    # Pillow for Alerts & Reports to generate PDFs of dashboards
    Pillow \
    # install Playwright for taking screenshots for Alerts & Reports. This assumes the feature flag PLAYWRIGHT_REPORTS_AND_THUMBNAILS is enabled
    # That feature flag will default to True starting in 6.0.0
    # Playwright works only with Chrome.
    # If you are still using Selenium instead of Playwright, you would instead install here the selenium package and a headless browser & webdriver
    playwright \
    && playwright install-deps \
    && PLAYWRIGHT_BROWSERS_PATH=/usr/local/share/playwright-browsers playwright install chromium

COPY superset_config.py /app/pythonpath/

# Switch back to the superset user
USER superset

CMD ["/app/docker/entrypoints/run-server.sh"]

Screenshots/recordings

No response

Superset version

5.0.0

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • [X ] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [ X] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [ X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: dosubot[bot]

French translations are supported in Superset 5.0.0, but they are not included in the default Docker image to reduce size and build time. To enable French (or any other non-English) translations, you need to build your own Docker image with the build argument BUILD_TRANSLATIONS=true. This triggers the build process to compile backend translations and generate frontend translation JSON files from the .po sources, making them available to the application. You do not need to manually copy messages.json files—these are generated during the build process from the .po files.

The translation files are located at superset/translations/fr/LC_MESSAGES/messages.po for the backend, and the frontend JSON files are generated from these using the build scripts. If you want translations in your build, set the Docker build argument and let the build process handle the rest. This change was introduced in 5.0.0 to reduce image bloat; translations are now opt-in for Docker builds. For more details, see the UPDATING.md notes and Dockerfile implementation.

If you build your image with BUILD_TRANSLATIONS=true, French translations should be available and work as expected.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

Comment From: RyanAccuWebCloud

To fix the French translation issue in Superset 5.0.0:

  1. Check Translation Files: Ensure the paths for messages.po (backend) and messages.json (frontend) are correct.
  2. Verify the BUILD_TRANSLATIONS Argument: Ensure it's being passed correctly during the build process.
  3. Manually Build Translations: Try manually building translation files with pybabel for the backend and verify frontend assets.
  4. Confirm Language in superset_config.py: Ensure French is selected as the default language.
  5. Check Logs: Review container logs for errors related to translations.
  6. Optional: If urgent, consider reverting to Superset 4.1.2 until the issue is fixed in 5.0.0.

For more flexibility and support, visit AccuWeb Cloud , they provide good support and excellent services .

Comment From: jpchev

To fix the French translation issue in Superset 5.0.0:

  1. Check Translation Files: Ensure the paths for messages.po (backend) and messages.json (frontend) are correct.
  2. Verify the BUILD_TRANSLATIONS Argument: Ensure it's being passed correctly during the build process.
  3. Manually Build Translations: Try manually building translation files with pybabel for the backend and verify frontend assets.
  4. Confirm Language in superset_config.py: Ensure French is selected as the default language.
  5. Check Logs: Review container logs for errors related to translations.
  6. Optional: If urgent, consider reverting to Superset 4.1.2 until the issue is fixed in 5.0.0.

For more flexibility and support, visit AccuWeb Cloud , they provide good support and excellent services .

thank you for your reply, so do I need to manually copy the translation files? @dosu says I don't need to.

I build with docker build --build-arg BUILD_TRANSLATIONS=true -t my-superset:5.0.0-custom . and I have this my superset_config.py file

BABEL_DEFAULT_LOCALE = "fr"

LANGUAGES = {
    "en": {"flag": "us", "name": "English"},
    "fr": {"flag": "fr", "name": "Français"},
}

but translations don't work.

BTW, what are the correct paths for messages.po (backend) and messages.json (frontend) ?

Comment From: dosubot[bot]

You do not need to manually copy translation files if you build your Superset 5.0.0 Docker image with BUILD_TRANSLATIONS=true—the build process should generate and include both backend (.mo) and frontend (.json) translation files automatically from the source .po files source.

If French translations still don't work, here’s what to check:

  • Make sure the build logs show that translation steps (like npm run build-translation and pybabel compile) ran without errors and produced files for French.
  • In your built image, confirm that superset/translations/fr/LC_MESSAGES/messages.json (frontend) and superset/translations/fr/LC_MESSAGES/messages.mo (backend) exist.
  • If the French option appears but doesn’t work, check the browser console for 404 errors or “Failed to fetch language pack” messages—this means the frontend JSON file is missing or not loaded source.
  • Locale codes must match between frontend and backend. For most setups, "fr" is correct, but if you use a variant or see a mismatch, add a bootstrap override in superset_config.py:
from superset.translations.utils import get_language_pack

def override_bootstrap_locale(data):
    if data.get("locale") == "fr":
        data["locale"] = "fr"
        data["language_pack"] = get_language_pack('fr')
    return data

COMMON_BOOTSTRAP_OVERRIDES_FUNC = override_bootstrap_locale
  • Some UI elements may remain untranslated if their keys are missing from the French translation files, especially in chart plugins and new UI features source.

If you follow these steps and translations still don’t work, check for errors in your build logs and browser console, and verify the translation files are present in the image. Let me know what you find!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

Comment From: jpchev

@dosu in my container the path /app/superset/translations/fr/LC_MESSAGES/ is empty, yet I've built it with BUILD_TRANSLATIONS=true

I noticed in the UI I see few menu items translated in french, but the majority are still in english, this looks like a bug

Comment From: dosubot[bot]

This is a known issue in Superset 5.0.0: even with BUILD_TRANSLATIONS=true, the translation build scripts have a bug that prevents the French translation files from being generated and included in the image. Specifically, the script that generates frontend translations uses an invalid find command, so it finds zero .po files and produces no .json or .mo files. The backend compilation step also suppresses errors, so failures are silent and the directory ends up empty—even if your config is correct and the source files exist. This is a regression in the Docker build process, not a misconfiguration on your part.
Reference

Workaround:
Until this is fixed upstream, you can manually generate the translation files on your machine and copy them into your image:

  1. On your host, in the Superset repo, run: bash pybabel compile -d superset/translations cd superset-frontend npm install npm run build-translation
  2. Copy the resulting messages.mo and messages.json files for French into your Docker build context.
  3. In your Dockerfile, copy them into /app/superset/translations/fr/LC_MESSAGES/ after the build steps.

This will ensure the files are present and translations work as expected.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

Comment From: jpchev

@dosu I've copied the files your mentioned to my container, the translation is still not working

/app$ ls /app/superset/translations/fr/LC_MESSAGES/ messages.json messages.mo messages.po

Comment From: dosubot[bot]

If you have messages.json, messages.mo, and messages.po in /app/superset/translations/fr/LC_MESSAGES/ but French translations still aren't working, here are the most likely causes and next steps:

  1. File validity: Double-check that messages.json and messages.mo are not empty or malformed. Open them and confirm they contain actual translation data, not just empty objects or error messages.

  2. Frontend loading: In your browser, open the developer tools (F12), go to the Network tab, and refresh the Superset UI. Look for requests to messages.json for 'fr' (or language pack loading errors). If you see 404 errors or "Failed to fetch language pack" messages, Superset is not finding or loading the file, which will cause a fallback to English. This can happen if the file is in the wrong location or if the frontend expects it elsewhere (for Superset 5.0.0, it should be in /app/superset/translations/fr/LC_MESSAGES/messages.json, not in static/assets/i18n) source.

  3. superset_config.py: Make sure your BABEL_DEFAULT_LOCALE and LANGUAGES config is being picked up by the running instance. The language picker in the UI should show French as an option, and the default locale should be set to "fr". If you use a variant (like fr_FR), you may need to add a bootstrap override in superset_config.py: ```python from superset.translations.utils import get_language_pack

def override_bootstrap_locale(data): if data.get("locale") == "fr": data["locale"] = "fr" data["language_pack"] = get_language_pack('fr') return data

COMMON_BOOTSTRAP_OVERRIDES_FUNC = override_bootstrap_locale ``` This ensures the frontend gets the correct language pack source.

  1. Cache: Superset caches translation files and bootstrap data. Try clearing your browser cache and restarting the Superset server/container to force a reload.

  2. Partial translations: If only some UI elements are translated, your messages.po/messages.json may be missing keys for newer UI components or chart plugins. This is a known limitation—translation coverage depends on the completeness of the .po file source.

  3. Logs: Check the Superset server logs for any errors or warnings about loading language packs or i18n.

If you check these and still have issues, please share any errors from the browser console or server logs, and confirm the contents of your translation files. This will help pinpoint whether it's a file, config, or runtime loading issue.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

Comment From: jpchev

@dosu it seems I can get translations when I compile the code source, for example running docker compose up but that's not what I want: I'd like to add translations to an official Superset docker image, or to an image of mine derived from an existing official image.

How to get that?