fix: tab item is not translated (#19735)

This commit is contained in:
Anik Dhabal Babu authored and GitHub committed 2025-03-05 09:28:45 +00:00
1 parent 251121a76f
commit fa58fe6563
2 files changed
+6 -2

No files matched your search

@@ -1,5 +1,6 @@
import Link from "next/link"; import Link from "next/link";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { useUrlMatchesCurrentUrl } from "@calcom/lib/hooks/useUrlMatchesCurrentUrl"; import { useUrlMatchesCurrentUrl } from "@calcom/lib/hooks/useUrlMatchesCurrentUrl";
import classNames from "@calcom/ui/classNames"; import classNames from "@calcom/ui/classNames";
@@ -33,6 +34,7 @@ const HorizontalTabItem = function ({
...props ...props
}: HorizontalTabItemProps) { }: HorizontalTabItemProps) {
const isCurrent = useUrlMatchesCurrentUrl(href, matchFullPath) || props?.isActive; const isCurrent = useUrlMatchesCurrentUrl(href, matchFullPath) || props?.isActive;
const { t } = useLocale();
return ( return (
<Link <Link
@@ -63,7 +65,7 @@ const HorizontalTabItem = function ({
aria-hidden="true" aria-hidden="true"
/> />
)} )}
{avatar && <Avatar size="xs" imageSrc={avatar} alt="avatar" className="-ml-0.5 me-1" />} {name} {avatar && <Avatar size="xs" imageSrc={avatar} alt="avatar" className="-ml-0.5 me-1" />} {t(name)}
</Link> </Link>
); );
}; };
@@ -1,6 +1,7 @@
import Link from "next/link"; import Link from "next/link";
import { Fragment } from "react"; import { Fragment } from "react";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { useUrlMatchesCurrentUrl } from "@calcom/lib/hooks/useUrlMatchesCurrentUrl"; import { useUrlMatchesCurrentUrl } from "@calcom/lib/hooks/useUrlMatchesCurrentUrl";
import classNames from "@calcom/ui/classNames"; import classNames from "@calcom/ui/classNames";
@@ -40,6 +41,7 @@ const VerticalTabItem = ({
...props ...props
}: VerticalTabItemProps) => { }: VerticalTabItemProps) => {
const isCurrent = useUrlMatchesCurrentUrl(href) || props?.isActive; const isCurrent = useUrlMatchesCurrentUrl(href) || props?.isActive;
const { t } = useLocale();
return ( return (
<Fragment key={name}> <Fragment key={name}>
@@ -76,7 +78,7 @@ const VerticalTabItem = ({
)} )}
<div className="h-fit min-w-0 flex-1"> <div className="h-fit min-w-0 flex-1">
<span className="flex items-center gap-2"> <span className="flex items-center gap-2">
{name} {t(name)}
{props.isExternalLink ? <Icon name="external-link" data-testid="external-link" /> : null} {props.isExternalLink ? <Icon name="external-link" data-testid="external-link" /> : null}
</span> </span>
{info && ( {info && (