Documentation editing (and Incident routing) broken in non-English UI locales — routeToTab uses hardcoded English tab names while tab names are i18n-translated
Describe the bug
After the i18n extraction of entity-type tab names, clicking Add Documentation / Edit on a dataset's Documentation tab does not open the description editor. Instead the UI navigates to the default tab (Schema/Columns). This happens only when the UI language is not English. English users are unaffected.
The same defect affects the Incidents tab routing (e.g. "Raise Incident").
To Reproduce
- Set the UI language to a non-English locale (e.g. German).
- Open any Dataset.
- Go to the Documentation tab and click Add Documentation or Edit (or, on an empty description, the
+button). - Observe: the app jumps to the Columns/Schema view instead of opening the documentation editor.
- Switch the UI language to English and repeat — it works.
Root cause
Tab routing resolves the active tab by strict name equality. In datahub-web-react/src/app/entityV2/shared/containers/profile/utils.tsx, useRoutedTab does:
const routedTab = tabs.find((tab) => tab.name === selectedTabPath);and getEntityPath builds the URL from the tabName passed to routeToTab (.../{tabName}?...).
The dataset Documentation tab's name was changed to a translated value in entityV2/dataset/DatasetEntity.tsx (PR #17701, feat(i18n): extract keys from entity type pages):
name: i18next.t('entity.types:tab.documentation'),
component: DocumentationTab,But the callers in DocumentationTab.tsx still route with a hardcoded English literal:
const DOCUMENTATION_TAB_NAME = 'Documentation';
routeToTab({ tabName: DOCUMENTATION_TAB_NAME, tabParams: { editing: true } });For non-English locales the tab name (e.g. German "Dokumentation") no longer equals the routed literal "Documentation", so useRoutedTab returns undefined and the profile falls back to the default (first) tab. In English the label equals the literal, which is why English users don't see it.
Affected call sites (entityV2)
shared/tabs/Documentation/DocumentationTab.tsx—DOCUMENTATION_TAB_NAME = 'Documentation'shared/tabs/Documentation/components/DescriptionPreviewModal.tsx— same literalshared/summary/SummaryAboutSection.tsx— same literalshared/EntityDropdown/RaiseIncidentMenuAction.tsx—INCIDENTS_TAB_NAME = 'Incidents'shared/EntityDropdown/EntityDropdown.tsx— same literal
(tab.incidents → German "Vorfälle", so Incident routing breaks identically.)
Suggested fix
Route by a stable, locale-independent tab identifier rather than the displayed name. Either match useRoutedTab against a non-translated id/key on the tab config, or have routeToTab callers pass the same i18next.t('entity.types:tab.documentation') value used for the tab name. The former is safer, since routing on a translated string means URLs also change with UI language.
Expected behavior
Clicking Add Documentation/Edit opens the documentation editor regardless of UI language.
Version
Reproduced on v1.7.0; not present on v1.6.0 (tab name was the hardcoded literal 'Documentation' there). Still present on current master as of this report.
Source: datahub-project/datahub