You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "dosubot[bot] (via GitHub)" <gi...@apache.org> on 2026/05/02 03:17:03 UTC
Re: [D] How to localize a language completely [superset]
GitHub user dosubot[bot] edited a comment on the discussion: How to localize a language completely
<!-- Greeting -->
Hi @iceangel86868686-bot! I'm [Dosu](https://go.dosu.dev/dosubot) and Iām helping the superset team.
<!-- Answer -->
The issue you're running into is a common one ā having translations in your `.po` and `.json` files doesn't automatically mean they'll show up in the UI. There are a few things to check:
**1. Ensure both backend and frontend translations are compiled**
Superset uses two separate translation pipelines [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/scripts/translations/babel_update.sh). Even if your `.po` file has the translation for "Metrics," you need to make sure both compilation steps have been run:
- **Backend** (`.po` ā `.mo`):
```bash
pybabel compile -d superset/translations
```
- **Frontend** (`.po` ā `.json`):
```bash
cd superset-frontend
npm run build-translation
```
(cite:docs:afdb9d10:549-568)
If you only updated the `.po` file but didn't recompile the `.json`, the frontend React components won't pick up those translations. Most of the UI labels you're seeing untranslated (like "Metrics") are rendered by the frontend, which reads from the `.json` file in JED format, not the `.po` file directly.
**2. Frontend loads translations via server-rendered bootstrap data**
The frontend doesn't load `.json` files separately at runtime. Instead, the backend embeds the language pack into the HTML page as bootstrap data (cite:code_file:48df91aa:130-141) (cite:code_file:135d84e8:37-43). This means after recompiling translations, you need to **restart the Superset server** for changes to take effect.
**3. Some strings may have plugin-level type mismatches**
A known issue is that some chart plugin `controlPanel` configurations use the translation function `t()` in a way that causes type mismatches, preventing translations from rendering (cite:thread:4d2fb152). For example, a label defined as `label: t('Metrics')` may not translate correctly if the component expects a function. The fix requires changing it to `label: () => t('Metrics')`.
**4. Incomplete translation coverage**
By default, Superset actually disables i18n because most language translations are incomplete (cite:code_file:9bbde5f2:401-403). The Russian `.po` file may not have translations for every string in the application. You can check completeness by looking for empty `msgstr` entries in your `.po` file:
```bash
grep -c 'msgstr ""' superset/translations/ru/LC_MESSAGES/messages.po
```
**Recommended steps:**
1. Re-run `pybabel compile -d superset/translations` and `npm run build-translation` (from `superset-frontend/`)
2. Restart the Superset server
3. Clear your browser cache and reload
4. For any remaining untranslated strings, check the `.po` file to confirm the `msgid` matches exactly (case-sensitive, including any trailing spaces)
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=a49ab580-a42e-40ea-898b-f39a1acc7ff8) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/39334#discussioncomment-16552898
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org