Skip to content

Commit 56a6362

Browse files
ericyangpanclaude
andcommitted
refactor(i18n): migrate from next/link to i18n-aware Link component
- Replace all next/link imports with @/i18n/navigation Link - Update 8 components and pages across the application - Remove manual locale prefixes from hrefs (handled automatically) - Ensure consistent internationalization across navigation Files updated: - src/app/[locale]/page.tsx - src/app/[locale]/articles/[slug]/page.tsx - src/app/[locale]/ai-coding-stack/page.tsx - src/app/[locale]/ai-coding-landscape/components/LandscapePage.tsx - src/components/Footer.tsx - src/components/Header.tsx - src/components/MegaMenu.tsx - src/components/controls/BackToNavigation.tsx 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 951c8eb commit 56a6362

File tree

8 files changed

+9
-8
lines changed

8 files changed

+9
-8
lines changed

src/app/[locale]/ai-coding-landscape/components/LandscapePage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use client';
22

3+
import { Link } from '@/i18n/navigation';
34
import LandscapeViewTabs from './LandscapeViewTabs';
45
import { BackToNavigation } from '@/components/controls/BackToNavigation';
56
import type {

src/app/[locale]/ai-coding-stack/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getTranslations } from 'next-intl/server';
2-
import Link from 'next/link';
2+
import { Link } from '@/i18n/navigation';
33
import Header from '@/components/Header';
44
import Footer from '@/components/Footer';
55
import StackSidebar from '@/components/sidebar/StackSidebar';
@@ -89,7 +89,7 @@ export default async function AICodingStackPage({ params }: Props) {
8989
].map((stack) => (
9090
<Link
9191
key={stack.key}
92-
href={`/${locale}/${stack.path}`}
92+
href={`/${stack.path}`}
9393
className="block border border-[var(--color-border)] p-[var(--spacing-md)] hover:border-[var(--color-border-strong)] transition-all hover:-translate-y-0.5 group"
9494
>
9595
<div className="flex justify-between items-start mb-[var(--spacing-md)]">

src/app/[locale]/articles/[slug]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Link from 'next/link';
1+
import { Link } from '@/i18n/navigation';
22
import { notFound } from 'next/navigation';
33
import Header from '@/components/Header';
44
import Footer from '@/components/Footer';

src/app/[locale]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Link from 'next/link';
1+
import { Link } from '@/i18n/navigation';
22
import Header from '@/components/Header';
33
import Footer from '@/components/Footer';
44
import { JsonLd } from '@/components/JsonLd';

src/components/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

33
import { memo, useCallback } from 'react';
4-
import Link from 'next/link';
4+
import { Link } from '@/i18n/navigation';
55
import { useTheme } from './ThemeProvider';
66
import LanguageSwitcher from './controls/LanguageSwitcher';
77
import { useTranslations } from 'next-intl';

src/components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

33
import { useState, memo } from 'react';
4-
import Link from 'next/link';
4+
import { Link } from '@/i18n/navigation';
55
import Image from 'next/image';
66
import { useTranslations } from 'next-intl';
77
import { MegaMenu } from './MegaMenu';

src/components/MegaMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import Link from 'next/link';
3+
import { Link } from '@/i18n/navigation';
44
import { useTranslations } from 'next-intl';
55

66
interface MegaMenuProps {

src/components/controls/BackToNavigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Link from 'next/link';
1+
import { Link } from '@/i18n/navigation';
22
import { useTranslations } from 'next-intl';
33

44
interface BackToNavigationProps {

0 commit comments

Comments
 (0)