Skip to content

Commit

Permalink
fix: Pass hrefLang to locale for test to go smoothly
Browse files Browse the repository at this point in the history
  • Loading branch information
ptbrowne committed Sep 13, 2024
1 parent dccd02c commit 20e9acf
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/language-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const CurrentPageLink = ({
}: {
locale: string;
passHref?: boolean;
hrefLang?: string;
children: ReactNode;
}) => {
const { pathname, query } = useRouter();
Expand Down Expand Up @@ -90,11 +91,16 @@ export const LanguageMenu = ({ contentId }: { contentId?: string }) => {
sx={{ ml: 1, p: 0, "& a": { textDecoration: "none" } }}
>
{alternate ? (
<NextLink href={alternate.path} passHref locale={false}>
{linkEl}
<NextLink
href={alternate.path}
passHref
hrefLang={locale}
locale={false}
>
hello{linkEl}
</NextLink>
) : (
<CurrentPageLink locale={locale} passHref>
<CurrentPageLink locale={locale} passHref hrefLang={locale}>
{linkEl}
</CurrentPageLink>
)}
Expand Down

0 comments on commit 20e9acf

Please sign in to comment.