Active menu item not highlighted when using Russian language
Bug description
Menu's active tab highlighting mechanism fails when Superset's interface language is set to Russian locale. This occurs because the active tab detection logic compares hardcoded English strings against localized menu item keys.
Note: The highlighting is currently broken for Russian locale, but this represents a systemic localization issue that affects all non-English interfaces. Any language where menu item translations don't exactly match the hardcoded English comparison strings will experience the same problem.
Steps to reproduce
- In config.py set the LANGUAGES variables:
LANGUAGES = {
"en": {"flag": "us", "name": "English"},
"ru": {"flag": "ru", "name": "Russian"},
}
- Open the "Dashboards" tab
- Observe that the "Dashboards" tab in the header is highlighted as active
- Switch the UI language to Russian language
- Open the "Dashboards" tab
- Observe that the "Dashboards" tab in the header is NOT highlighted as active
Screenshots/recordings
English (working):
Russian (broken):
Superset version
master / latest-dev
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.
- [ ] 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.
You've correctly identified a systemic bug: Superset's active menu highlighting logic uses hardcoded English strings (like "Dashboards", "Charts", "Datasets") to set the active tab, but menu labels are localized, so the highlighting fails in non-English interfaces such as Russian. This logic is in the frontend code (Menu.tsx), where the active tab is set by matching the current route to these English strings, not to a route or a localization key.
Workarounds for other i18n issues (like overriding the bootstrap locale function or rebuilding translations) do not fix this core problem, since the comparison is still against hardcoded English strings, not keys or routes. The only robust solution is to refactor the active tab detection to use route-based or key-based matching, independent of the displayed (localized) label. This would ensure correct highlighting regardless of language.
If you want to address this, look for places in the code where setActiveTabs is called with English strings and change the logic to use a stable key (like a route or an internal identifier) for both menu rendering and active tab detection. This will prevent mismatches when the UI is localized.
References:
- Menu.tsx highlighting logic
- Systemic i18n issues and workarounds
- Global translation loading and async bugs
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Do you have any custom CSS or Themes applied?
@rusackas No, I don't have any custom CSS or themes applied. The issue reproduces with the default Superset theme.