Skip to content

Commit

Permalink
chore(topology): localize mode icon label
Browse files Browse the repository at this point in the history
  • Loading branch information
Thuan Vo committed May 8, 2023
1 parent c19f373 commit df1ed4d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions locales/en/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -390,5 +390,9 @@
"SELECT": "Select a timezone",
"TYPE_AHEAD": "Search a timezone"
}
},
"Topology": {
"GRAPH_VIEW": "List View",
"LIST_VIEW": "Graph View"
}
}
6 changes: 4 additions & 2 deletions src/app/Topology/Toolbar/TopologyToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import { HelpButton } from './HelpButton';
import { QuickSearchButton } from './QuickSearchButton';
import { TopologyFilterChips } from './TopologyFilterChips';
import { TopologyFilters } from './TopologyFilters';
import { useTranslation } from 'react-i18next';

export enum TopologyToolbarVariant {
Graph = 'graph',
Expand All @@ -65,6 +66,7 @@ export interface TopologyToolbarProps {
export const TopologyToolbar: React.FC<TopologyToolbarProps> = ({ variant, visualization, isDisabled, ...props }) => {
const isGraphView = variant === TopologyToolbarVariant.Graph;
const dispatch = useDispatch();
const { t } = useTranslation();

const [quicksearchOpen, setQuicksearchOpen] = React.useState(false);

Expand All @@ -89,7 +91,7 @@ export const TopologyToolbar: React.FC<TopologyToolbarProps> = ({ variant, visua
() => (
<Tooltip
entryDelay={0}
content={isGraphView ? 'List View' : 'Graph View'}
content={isGraphView ? t('Topology.LIST_VIEW') : t('Topology.GRAPH_VIEW')}
aria="none"
aria-live="polite"
appendTo={portalRoot}
Expand All @@ -99,7 +101,7 @@ export const TopologyToolbar: React.FC<TopologyToolbarProps> = ({ variant, visua
</Button>
</Tooltip>
),
[isGraphView, toggleView]
[isGraphView, toggleView, t]
);

const shortcuts = React.useMemo(() => {
Expand Down

0 comments on commit df1ed4d

Please sign in to comment.