dosubot[bot] commented on issue #34058: URL: https://github.com/apache/superset/issues/34058#issuecomment-3033914313
<!-- Answer --> This is a known issue in Superset: even if the backend and Flask-Babel are set to pt_BR and the translation for "Settings" exists, the frontend may still show "Settings" in English because the frontend and backend handle translations separately. By default, the backend sends only the language code (like "pt") to the frontend, which causes the frontend to load the wrong language pack and miss the pt_BR translation for menu items like "Settings" (and this affects other languages too) [[discussion](https://github.com/apache/superset/discussions/33594)]. To fix this, add the following to your `superset/config.py`: ```python from superset.translations.utils import get_language_pack def override_bootstrap_locale(data): if data.get("locale") == "pt": data["locale"] = "pt_BR" data["language_pack"] = get_language_pack('pt_BR') return data COMMON_BOOTSTRAP_OVERRIDES_FUNC = override_bootstrap_locale ``` Then rebuild your frontend translations: ```bash cd superset-frontend/ npm run build-translation ``` This ensures the frontend receives and loads the correct pt_BR language pack, so "Settings" and other menu items will be translated as expected [[discussion](https://github.com/apache/superset/discussions/33594)]. If you still see mixed languages, check that your `LANGUAGES` dictionary in `superset/config.py` includes `"pt_BR"` and that your translation files are up to date and compiled [[docs](https://github.com/apache/superset/discussions/31444)]. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/56761297-bf3f-4292-bace-9f23c7a65549?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/56761297-bf3f-4292-bace-9f23c7a65549?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/56761297-bf3f-4292-bace-9f23c7a65549?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/56761297-bf3f-4292-bace-9f23c7a65549?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/56761297-bf3f-4292-bace-9f23c7a65549?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/56761297-bf3f-4292-bace-9f23c7a65549?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/56761297-bf3f-4292-bace-9f23c7a65549?feedback_type=other)</sup> [](https://go.dosu.dev/discord-bot) [! [Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/34058) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
