GitHub user dosubot[bot] added a comment to the discussion: superset localisation
<!-- Answer --> To save and display dashboard elements, including chart names and SQL responses, in different languages in Superset, follow these steps: 1. **Enable Multi-Language Support:** - Modify `superset/config.py` to include Babel configuration with `BABEL_DEFAULT_LOCALE`, `BABEL_DEFAULT_FOLDER`, and `LANGUAGES` settings. Populate the `LANGUAGES` dictionary with the desired languages and their respective flags and names <sup>[[1]](https://github.com/apache/superset/discussions/31444)</sup>. 2. **Translation Files:** - Use `pybabel` commands to initialize and update translation files: ```bash pybabel init -i superset/translations/messages.pot -d superset/translations -l LANGUAGE_CODE ./scripts/translations/babel_update.sh pybabel update -i superset/translations/messages.pot -d superset/translations --ignore-obsolete ``` - Replace `LANGUAGE_CODE` with the code of the language you want to add <sup>[[1]](https://github.com/apache/superset/discussions/31444)</sup>. 3. **Frontend Configuration:** - Install dependencies and build translations: ```bash cd superset-frontend/ && npm ci npm run build-translation ``` - Use the `i18n.ts` file to define translations for different languages. You can add translations for chart names and SQL responses in this file <sup>[[2]](https://github.com/apache/superset/blob/master/superset-frontend/plugins/plugin-chart-table/src/i18n.ts)</sup>. 4. **Language Picker:** - Ensure the `LANGUAGES` dictionary in `superset/config.py` is not empty and includes the languages you want to support. The language picker functionality is available through the UI via `superset-frontend/src/features/home/LanguagePicker.tsx` <sup>[[1]](https://github.com/apache/superset/discussions/31444)</sup>. By following these steps, you can configure Superset to save and display dashboard elements, including chart names and SQL responses, in multiple languages. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/51e6cd69-1abe-425d-a6fb-d98f935d555e?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/51e6cd69-1abe-425d-a6fb-d98f935d555e?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/51e6cd69-1abe-425d-a6fb-d98f935d555e?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/51e6cd69-1abe-425d-a6fb-d98f935d555e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/51e6cd69-1abe-425d-a6fb-d98f935d555e?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/51e6cd69-1abe-425d-a6fb-d98f935d555e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/51e6cd69-1abe-425d-a6fb-d98f935d555e?feedback_type=other)</sup> GitHub link: https://github.com/apache/superset/discussions/33005#discussioncomment-12732585 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
