Skip to content

Commit

Permalink
fix(bcd): link to pages in same locale (#10373)
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner authored Jan 23, 2024
1 parent 078fa86 commit 4ac6fdf
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
SupportStatementExtended,
} from "./utils";
import { LEGEND_LABELS } from "./legend";
import { DEFAULT_LOCALE } from "../../../../../libs/constants";

function getSupportClassName(
support: SupportStatementExtended | undefined,
Expand Down Expand Up @@ -525,8 +526,12 @@ export const FeatureRow = React.memo(
let titleNode: string | React.ReactNode;

if (compat.mdn_url && depth > 0) {
const href = compat.mdn_url.replace(
`/${DEFAULT_LOCALE}/docs`,
`/${locale}/docs`
);
titleNode = (
<a href={compat.mdn_url} className="bc-table-row-header">
<a href={href} className="bc-table-row-header">
{title}
{compat.status && <StatusIcons status={compat.status} />}
</a>
Expand Down

0 comments on commit 4ac6fdf

Please sign in to comment.