dosubot[bot] commented on issue #36403: URL: https://github.com/apache/superset/issues/36403#issuecomment-3605686924
<!-- Answer --> 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](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/features/home/Menu.tsx#L147-L365)), 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](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/features/home/Menu.tsx#L147-L365) - [Systemic i18n issues and workarounds](https://github.com/apache/superset/issues/34058) - [Global translation loading and async bugs](https://github.com/apache/superset/issues/35569) <!-- 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/7f7ab896-f836-4ff8-bb37-fa3f13e345f7?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/7f7ab896-f836-4ff8-bb37-fa3f13e345f7?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/7f7ab896-f836-4ff8-bb37-fa3f13e345f7?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/7f7ab896-f836-4ff8-bb37-fa3f13e345f7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7f7ab896-f836-4ff8-bb37-fa3f13e345f7?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/7f7ab896-f836-4ff8-bb37-fa3f13e345f7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7f7ab896-f836-4ff8-bb37-fa3f13e345f7?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=You%27ve%20correctly%20identified%20a%20systemic%20bug%3A%20Superset%27s%20active%20menu%20highlighting%20logic%20uses%20hardcoded%20English%20strings%20%28like%20%60%22Dashboards%22%60%2C%20%60%22Charts%22%60%2C%20%60%22Datasets%22%60%29%20to%20set%20the%20active%20tab%2C%20but%20menu%20labels%20are%20localized%2C%20so%20the%20highlighting%20fails%20in%20non-English%20interfaces%20such%20as%20Russian.%20This%20logic%20is%20in%20the%20frontend%20code%20%28%5BMenu.tsx%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/features/home/Menu.tsx%23L147-L365%29%29%2C%20where%20the%20active%20tab%20is%20set%20by%20matching%20the%20current%20route%20to%20these%20English%20strings%2C%20not%20to%20a%2 0route%20or%20a%20localization%20key.%0A%0AWorkarounds%20for%20other%20i18n%20issues%20%28like%20overriding%20the%20bootstrap%20locale%20function%20or%20rebuilding%20translations%29%20do%20not%20fix%20this%20core%20problem%2C%20since%20the%20comparison%20is%20still%20against%20hardcoded%20English%20strings%2C%20not%20keys%20or%20routes.%20The%20only%20robust%20solution%20is%20to%20refactor%20the%20active%20tab%20detection%20to%20use%20route-based%20or%20key-based%20matching%2C%20independent%20of%20the%20displayed%20%28localized%29%20label.%20This%20would%20ensure%20correct%20highlighting%20regardless%20of%20language.%0A%0AIf%20you%20want%20to%20address%20this%2C%20look%20for%20places%20in%20the%20code%20where%20%60setActiveTabs%60%20is%20called%20with%20English%20strings%20and%20change%20the%20logic%20to%20use%20a%20stable%20key%20%28like%20a%20route%20or%20an%20internal%20identifier%29%20for%20both%20menu%20rendering%20and%20active%20tab%20detection.%20This%20will%20prevent%20misma tches%20when%20the%20UI%20is%20localized.%0A%0AReferences%3A%0A-%20%5BMenu.tsx%20highlighting%20logic%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/features/home/Menu.tsx%23L147-L365%29%0A-%20%5BSystemic%20i18n%20issues%20and%20workarounds%5D%28https%3A//github.com/apache/superset/issues/34058%29%0A-%20%5BGlobal%20translation%20loading%20and%20async%20bugs%5D%28https%3A//github.com/apache/superset/issues/35569%29) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36403) -- 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]
