diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 56cfac0c7..950ff8205 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,6 +8,9 @@ on: branches: - main - feat/napi-binding + # Stacked Korean translation PRs; remove once they merge. + - feat/ko-shell + - feat/ko-home # Pull requests and every job below run read-only. Only the `release` and # `deploy-pages` jobs get write permissions, and they run on pushes to main diff --git a/apps/landing/src/app/(detail)/page.ko.tsx b/apps/landing/src/app/(detail)/page.ko.tsx new file mode 100644 index 000000000..d25bbed21 --- /dev/null +++ b/apps/landing/src/app/(detail)/page.ko.tsx @@ -0,0 +1,47 @@ +import { Box } from '@devup-ui/react' +import type { Metadata } from 'next' + +import { Bench } from '@/app/Bench' +import { Feature } from '@/app/Feature' +import { TopBanner } from '@/app/TopBanner' +import { Container } from '@/components/Container' +import { Discord } from '@/components/Discord' + +const description = + 'Zero Config, Zero FOUC, Zero Runtime을 실현하는 CSS-in-JS 전처리기' + +export const metadata: Metadata = { + description, + alternates: { + canonical: '/ko', + languages: { + en: '/', + ko: '/ko', + 'x-default': '/', + }, + }, + openGraph: { + title: 'Devup UI', + description, + images: ['https://devup-ui.com/og-image.png'], + locale: 'ko_KR', + siteName: 'Devup UI', + type: 'website', + url: '/ko', + }, +} + +export default function HomePage() { + return ( + <> + + + + + + + + + + ) +} diff --git a/apps/landing/src/app/(detail)/page.tsx b/apps/landing/src/app/(detail)/page.tsx index fcf7db2a0..8b4b56389 100644 --- a/apps/landing/src/app/(detail)/page.tsx +++ b/apps/landing/src/app/(detail)/page.tsx @@ -11,6 +11,11 @@ import { TopBanner } from '../TopBanner' export const metadata: Metadata = { alternates: { canonical: '/', + languages: { + en: '/', + ko: '/ko', + 'x-default': '/', + }, }, } diff --git a/apps/landing/src/app/(detail)/showcase/page.ko.tsx b/apps/landing/src/app/(detail)/showcase/page.ko.tsx new file mode 100644 index 000000000..614b53888 --- /dev/null +++ b/apps/landing/src/app/(detail)/showcase/page.ko.tsx @@ -0,0 +1,50 @@ +import { Text, VStack } from '@devup-ui/react' +import type { Metadata } from 'next' + +import { SHOWCASE_LIST } from '@/components/showcase/showcase-list' +import { ShowcaseContent } from '@/components/showcase/ShowcaseContent' + +export const metadata: Metadata = { + title: 'Devup UI 쇼케이스', + description: 'Devup UI로 만든 웹사이트와 앱을 소개합니다.', + alternates: { + canonical: '/ko/showcase', + languages: { + en: '/showcase', + ko: '/ko/showcase', + 'x-default': '/showcase', + }, + }, + openGraph: { + title: 'Devup UI 쇼케이스', + description: 'Devup UI로 만든 웹사이트와 앱을 소개합니다.', + url: '/ko/showcase', + siteName: 'Devup UI', + images: ['/og-image.png'], + locale: 'ko_KR', + }, +} + +export default function Page() { + return ( + + + + 쇼케이스 + + + Devup UI로 만든 다양한 웹사이트를 소개합니다 + + + + + ) +} diff --git a/apps/landing/src/app/(detail)/showcase/page.tsx b/apps/landing/src/app/(detail)/showcase/page.tsx index 7c89709b1..ed9b26f58 100644 --- a/apps/landing/src/app/(detail)/showcase/page.tsx +++ b/apps/landing/src/app/(detail)/showcase/page.tsx @@ -1,6 +1,7 @@ import { Text, VStack } from '@devup-ui/react' import type { Metadata } from 'next' +import { SHOWCASE_LIST } from '@/components/showcase/showcase-list' import { ShowcaseContent } from '@/components/showcase/ShowcaseContent' export const metadata: Metadata = { @@ -8,6 +9,11 @@ export const metadata: Metadata = { description: 'Websites and apps built with Devup UI.', alternates: { canonical: '/showcase', + languages: { + en: '/showcase', + ko: '/ko/showcase', + 'x-default': '/showcase', + }, }, openGraph: { title: 'Devup UI Showcase', @@ -18,93 +24,6 @@ export const metadata: Metadata = { }, } -const SHOWCASE_LIST = [ - { - id: 'devfive', - name: 'Devfive', - image: '/showcase/devfive.webp', - type: 'website', - link: 'https://devfive.kr', - }, - { - id: 'braillify', - name: 'Braillify', - image: '/showcase/braillify.webp', - type: 'website', - link: 'https://braillify.kr', - }, - { - id: 'ideocean', - name: 'IDeOcean', - image: '/showcase/ideocean.webp', - type: 'website', - link: 'https://ideaocean.ai/', - }, - { - id: 'ongle', - name: 'Ongle', - image: '/showcase/ongle.webp', - type: 'website', - link: 'https://easy-read.co.kr', - }, - { - id: 'laon_singcraft', - name: 'Laon Singcraft', - image: '/showcase/laon_singcraft.webp', - type: 'website', - link: 'https://laonswingcraft.com/', - }, - { - id: 'point_park', - name: 'PointPark', - image: '/showcase/point_park.webp', - type: 'mobile', - link: 'https://play.google.com/store/apps/details?id=com.pointpark.popaArdApp&hl=ko', - }, - { - id: 'nh_allone_bank', - name: 'NH Allone Bank', - image: '/showcase/nh_allone_bank.webp', - type: 'mobile', - link: 'https://play.google.com/store/apps/details?id=com.nonghyup.nhallonebank', - }, - { - id: 'your_test', - name: 'Your Test', - image: '/showcase/your_test.webp', - type: 'website', - link: 'https://www.yourtest.kr/', - }, - { - id: 'util_support', - name: 'Util Support', - image: '/showcase/util_support.webp', - type: 'website', - link: 'https://util.support/', - }, - { - id: 'justq', - name: 'Justq', - image: '/showcase/justq.webp', - type: 'website', - link: 'https://www.justq.com/', - }, - { - id: 'kavia', - name: 'Kavia', - image: '/showcase/kavia.webp', - type: 'website', - link: 'https://kavia.org/', - }, - { - id: 'boratial', - name: 'Boratial', - image: '/showcase/boratial.webp', - type: 'website', - link: 'https://www.boratr.co.kr', - }, -] - export default function Page() { return ( - Comparison Benchmarks + {t('benchmarksTitle')} - Next.js {results.run.next} cold build, median of {results.samples}{' '} - (GitHub Actions{' '} - - run {results.run.id} - - , commit{' '} - - {results.run.commit} - - ) + {t.rich('benchmarksCaption', { + commit: results.run.commit, + id: results.run.id, + next: results.run.next, + samples: results.samples, + commitLink: (chunks) => ( + + {chunks} + + ), + runLink: (chunks) => ( + + {chunks} + + ), + })} - + - + {OTHER_CARDS.map((item) => ( - + ))} diff --git a/apps/landing/src/app/DevupUICard.tsx b/apps/landing/src/app/DevupUICard.tsx index 8021fefac..1b6aed31f 100644 --- a/apps/landing/src/app/DevupUICard.tsx +++ b/apps/landing/src/app/DevupUICard.tsx @@ -1,4 +1,6 @@ import { Box, Flex, Image, Text, VStack } from '@devup-ui/react' +import type { Locale } from 'next-intl' +import { getTranslations } from 'next-intl/server' interface DevupUICardProps { version: string @@ -8,6 +10,7 @@ interface DevupUICardProps { fastest: boolean /** Whether Devup UI builds smaller than every other card */ smallest: boolean + locale?: Locale } function Crown({ shown }: { shown: boolean }) { @@ -26,13 +29,15 @@ function Crown({ shown }: { shown: boolean }) { ) } -export function DevupUICard({ +export async function DevupUICard({ version, buildTime, buildSize, fastest, smallest, + locale = 'en', }: DevupUICardProps) { + const t = await getTranslations({ locale, namespace: 'Home' }) return ( - Next.js Build Time (single CSS) + {t('devupBuildTime')} @@ -84,7 +89,7 @@ export function DevupUICard({ - Build Size + {t('buildSize')} diff --git a/apps/landing/src/app/Feature.tsx b/apps/landing/src/app/Feature.tsx index a9fbf38b7..caa66c555 100644 --- a/apps/landing/src/app/Feature.tsx +++ b/apps/landing/src/app/Feature.tsx @@ -1,57 +1,35 @@ import { Box, css, Flex, Grid, Image, Text, VStack } from '@devup-ui/react' +import type { Locale } from 'next-intl' +import { getTranslations } from 'next-intl/server' import { Link } from '@/i18n/navigation' const FEATURES = [ - { - icon: '/idea.svg', - title: 'Zero Runtime', - desc: 'A futuristic design that eliminates the root causes of performance degradation.', - }, - { - icon: '/trophy.svg', - title: 'Top Performance', - desc: 'The fastest build speed and the smallest bundle size among CSS-in-JS solutions.', - }, - { - icon: '/heart.svg', - title: 'Type Safety', - desc: 'Enhanced DX with typing-based support.', - }, - { - icon: '/notice.svg', - title: 'Figma Plugin', - desc: 'A Figma plugin enabling safer and faster development.', - extra: ( - - - - ), - }, -] + { icon: '/idea.svg', key: 'zeroRuntime' }, + { icon: '/trophy.svg', key: 'topPerformance' }, + { icon: '/heart.svg', key: 'typeSafety' }, + { icon: '/notice.svg', key: 'figmaPlugin' }, +] as const -export function Feature() { +export async function Feature({ locale = 'en' }: { locale?: Locale }) { + const t = await getTranslations({ locale, namespace: 'Home' }) return ( - Features + {t('featuresTitle')} - Devup UI offers a performance-optimized CSS-in-JS system, theme - typing, - and amazing features for faster and safer development. + {t.rich('featuresDescription', { + br: () => , + })} - {FEATURES.map(({ icon, title, desc, extra }) => ( + {FEATURES.map(({ icon, key }) => ( - {title} + {t(`features.${key}.title`)} - {desc} + {t(`features.${key}.description`)} - {extra} + {key === 'figmaPlugin' && ( + + + + )} ))} @@ -80,7 +66,7 @@ export function Feature() { ) } -export function FigmaButton() { +function FigmaButton({ label }: { label: string }) { return ( - Go Figma Community + {label} - Get started + {t('getStarted')} diff --git a/apps/landing/src/app/OtherCard.tsx b/apps/landing/src/app/OtherCard.tsx index 1c213b66c..9964aab30 100644 --- a/apps/landing/src/app/OtherCard.tsx +++ b/apps/landing/src/app/OtherCard.tsx @@ -1,5 +1,7 @@ import { css, Flex, Text, VStack } from '@devup-ui/react' import Link from 'next/link' +import type { Locale } from 'next-intl' +import { getTranslations } from 'next-intl/server' interface OtherCardProps { title: string @@ -7,14 +9,17 @@ interface OtherCardProps { buildTime: string buildSize: string url: string + locale?: Locale } -export function OtherCard({ +export async function OtherCard({ title, version, buildTime, buildSize, url, + locale = 'en', }: OtherCardProps) { + const t = await getTranslations({ locale, namespace: 'Home' }) return ( - Build Time + {t('buildTime')} {buildTime} @@ -56,7 +61,7 @@ export function OtherCard({ - Build Size + {t('buildSize')} {buildSize} diff --git a/apps/landing/src/app/TopBanner.tsx b/apps/landing/src/app/TopBanner.tsx index e754b6cb1..f42788b58 100644 --- a/apps/landing/src/app/TopBanner.tsx +++ b/apps/landing/src/app/TopBanner.tsx @@ -1,4 +1,6 @@ import { Box, Flex, Image, Text, VStack } from '@devup-ui/react' +import type { Locale } from 'next-intl' +import { getTranslations } from 'next-intl/server' import { LandingTitle } from '@/LandingTitle' @@ -6,7 +8,8 @@ import { GetStartedButton } from './GetStartedButton' import SponsorButton from './SponsorButton' import StarButton from './StarButton' -export function TopBanner() { +export async function TopBanner({ locale = 'en' }: { locale?: Locale }) { + const t = await getTranslations({ locale, namespace: 'Home' }) return ( {' '} Runtime - CSS in JS Preprocessor + {t('preprocessor')} - Building the Future of CSS-in-JS -
- Analyze all possible scenarios at the fastest speed and style with - optimal performance. + {t.rich('tagline', { br: () =>
})}
- + diff --git a/apps/landing/src/components/Discord.tsx b/apps/landing/src/components/Discord.tsx index 6d6c40ec0..2bb9f42ae 100644 --- a/apps/landing/src/components/Discord.tsx +++ b/apps/landing/src/components/Discord.tsx @@ -1,7 +1,10 @@ import { css, Flex, Image, Text, VStack } from '@devup-ui/react' import Link from 'next/link' +import type { Locale } from 'next-intl' +import { getTranslations } from 'next-intl/server' -export function Discord() { +export async function Discord({ locale = 'en' }: { locale?: Locale }) { + const t = await getTranslations({ locale, namespace: 'Home' }) return ( - Join our community + {t('communityTitle')} - Join our Discord and help build the future of frontend with - CSS-in-JS! + {t('communityDescription')} @@ -55,7 +57,7 @@ export function Discord() { > - Open KakaoTalk + {t('openKakaoTalk')} @@ -83,7 +85,7 @@ export function Discord() { > - Join our Discord + {t('joinDiscord')} diff --git a/apps/landing/src/components/showcase/ShowcaseCard.tsx b/apps/landing/src/components/showcase/ShowcaseCard.tsx index 5a85befdb..040169d5b 100644 --- a/apps/landing/src/components/showcase/ShowcaseCard.tsx +++ b/apps/landing/src/components/showcase/ShowcaseCard.tsx @@ -1,10 +1,12 @@ import { Box, Flex, Image, Text, VStack } from '@devup-ui/react' +import { useTranslations } from 'next-intl' interface ShowcaseCardProps { name: string image: string } export function ShowcaseCard({ name, image }: ShowcaseCardProps) { + const t = useTranslations('Showcase') return ( @@ -30,7 +32,7 @@ export function ShowcaseCard({ name, image }: ShowcaseCardProps) {
- Visit Site + {t('visitSite')} ('All') const filteredList = useMemo( @@ -61,7 +63,7 @@ export function ShowcaseContent({ list }: ShowcaseContentProps) { color={segment === item ? '$primary' : '$caption'} typography="buttonM" > - {item} + {t(`segments.${item}`)} ))} diff --git a/apps/landing/src/components/showcase/showcase-list.ts b/apps/landing/src/components/showcase/showcase-list.ts new file mode 100644 index 000000000..1fd5c82f6 --- /dev/null +++ b/apps/landing/src/components/showcase/showcase-list.ts @@ -0,0 +1,86 @@ +export const SHOWCASE_LIST = [ + { + id: 'devfive', + name: 'Devfive', + image: '/showcase/devfive.webp', + type: 'website', + link: 'https://devfive.kr', + }, + { + id: 'braillify', + name: 'Braillify', + image: '/showcase/braillify.webp', + type: 'website', + link: 'https://braillify.kr', + }, + { + id: 'ideocean', + name: 'IDeOcean', + image: '/showcase/ideocean.webp', + type: 'website', + link: 'https://ideaocean.ai/', + }, + { + id: 'ongle', + name: 'Ongle', + image: '/showcase/ongle.webp', + type: 'website', + link: 'https://easy-read.co.kr', + }, + { + id: 'laon_singcraft', + name: 'Laon Singcraft', + image: '/showcase/laon_singcraft.webp', + type: 'website', + link: 'https://laonswingcraft.com/', + }, + { + id: 'point_park', + name: 'PointPark', + image: '/showcase/point_park.webp', + type: 'mobile', + link: 'https://play.google.com/store/apps/details?id=com.pointpark.popaArdApp&hl=ko', + }, + { + id: 'nh_allone_bank', + name: 'NH Allone Bank', + image: '/showcase/nh_allone_bank.webp', + type: 'mobile', + link: 'https://play.google.com/store/apps/details?id=com.nonghyup.nhallonebank', + }, + { + id: 'your_test', + name: 'Your Test', + image: '/showcase/your_test.webp', + type: 'website', + link: 'https://www.yourtest.kr/', + }, + { + id: 'util_support', + name: 'Util Support', + image: '/showcase/util_support.webp', + type: 'website', + link: 'https://util.support/', + }, + { + id: 'justq', + name: 'Justq', + image: '/showcase/justq.webp', + type: 'website', + link: 'https://www.justq.com/', + }, + { + id: 'kavia', + name: 'Kavia', + image: '/showcase/kavia.webp', + type: 'website', + link: 'https://kavia.org/', + }, + { + id: 'boratial', + name: 'Boratial', + image: '/showcase/boratial.webp', + type: 'website', + link: 'https://www.boratr.co.kr', + }, +] diff --git a/apps/landing/src/i18n/messages/en.json b/apps/landing/src/i18n/messages/en.json index 26e664cb5..770e2709a 100644 --- a/apps/landing/src/i18n/messages/en.json +++ b/apps/landing/src/i18n/messages/en.json @@ -46,6 +46,41 @@ "team": "Team", "toggleTheme": "Toggle color theme" }, + "Home": { + "benchmarksCaption": "Next.js {next} cold build, median of {samples} (GitHub Actions run {id}, commit {commit})", + "benchmarksTitle": "Comparison Benchmarks", + "buildSize": "Build Size", + "buildTime": "Build Time", + "communityDescription": "Join our Discord and help build the future of frontend with CSS-in-JS!", + "communityTitle": "Join our community", + "devupBuildTime": "Next.js Build Time (single CSS)", + "features": { + "figmaPlugin": { + "description": "A Figma plugin enabling safer and faster development.", + "title": "Figma Plugin" + }, + "topPerformance": { + "description": "The fastest build speed and the smallest bundle size among CSS-in-JS solutions.", + "title": "Top Performance" + }, + "typeSafety": { + "description": "Enhanced DX with typing-based support.", + "title": "Type Safety" + }, + "zeroRuntime": { + "description": "A futuristic design that eliminates the root causes of performance degradation.", + "title": "Zero Runtime" + } + }, + "featuresDescription": "Devup UI offers a performance-optimized CSS-in-JS system, theme typing,

and amazing features for faster and safer development.", + "featuresTitle": "Features", + "getStarted": "Get started", + "goFigmaCommunity": "Go Figma Community", + "joinDiscord": "Join our Discord", + "openKakaoTalk": "Open KakaoTalk", + "preprocessor": "CSS in JS Preprocessor", + "tagline": "Building the Future of CSS-in-JS

Analyze all possible scenarios at the fastest speed and style with optimal performance." + }, "RightIndex": { "contents": "Contents", "editThisPage": "Edit this page" @@ -53,5 +88,13 @@ "Search": { "loading": "Loading...", "noResults": "No recent searches" + }, + "Showcase": { + "segments": { + "All": "All", + "Mobile": "Mobile", + "Website": "Website" + }, + "visitSite": "Visit Site" } } diff --git a/apps/landing/src/i18n/messages/ko.json b/apps/landing/src/i18n/messages/ko.json index a3cc9fc76..904e0f555 100644 --- a/apps/landing/src/i18n/messages/ko.json +++ b/apps/landing/src/i18n/messages/ko.json @@ -46,6 +46,41 @@ "team": "팀", "toggleTheme": "색상 테마 전환" }, + "Home": { + "benchmarksCaption": "Next.js {next} 콜드 빌드, {samples}회 측정 중앙값 (GitHub Actions 실행 {id}, 커밋 {commit})", + "benchmarksTitle": "벤치마크 비교", + "buildSize": "빌드 크기", + "buildTime": "빌드 시간", + "communityDescription": "Discord에 참여해 CSS-in-JS로 프런트엔드의 미래를 함께 만들어 가세요!", + "communityTitle": "커뮤니티에 참여하세요", + "devupBuildTime": "Next.js 빌드 시간 (single CSS)", + "features": { + "figmaPlugin": { + "description": "더 안전하고 빠른 개발을 돕는 Figma 플러그인입니다.", + "title": "Figma 플러그인" + }, + "topPerformance": { + "description": "CSS-in-JS 솔루션 가운데 가장 빠른 빌드 속도와 가장 작은 번들 크기를 제공합니다.", + "title": "최고의 성능" + }, + "typeSafety": { + "description": "타입 기반 지원으로 개발자 경험을 높입니다.", + "title": "타입 안전성" + }, + "zeroRuntime": { + "description": "성능 저하의 근본 원인을 없애는 미래지향적인 설계입니다.", + "title": "제로 런타임" + } + }, + "featuresDescription": "Devup UI는 성능에 최적화된 CSS-in-JS 시스템과 테마 타입 지원,

더 빠르고 안전한 개발을 위한 강력한 기능을 제공합니다.", + "featuresTitle": "주요 기능", + "getStarted": "시작하기", + "goFigmaCommunity": "Figma 커뮤니티로 이동", + "joinDiscord": "Discord 참여하기", + "openKakaoTalk": "카카오톡 오픈채팅 열기", + "preprocessor": "CSS-in-JS 전처리기", + "tagline": "CSS-in-JS의 미래를 만듭니다

가능한 모든 시나리오를 가장 빠르게 분석하고, 최적의 성능으로 스타일을 적용합니다." + }, "RightIndex": { "contents": "목차", "editThisPage": "이 페이지 편집" @@ -53,5 +88,13 @@ "Search": { "loading": "불러오는 중...", "noResults": "검색 결과가 없습니다" + }, + "Showcase": { + "segments": { + "All": "전체", + "Mobile": "모바일", + "Website": "웹사이트" + }, + "visitSite": "사이트 방문" } } diff --git a/apps/landing/src/i18n/pages.ts b/apps/landing/src/i18n/pages.ts index 1cf850c83..f22d8a563 100644 --- a/apps/landing/src/i18n/pages.ts +++ b/apps/landing/src/i18n/pages.ts @@ -11,6 +11,13 @@ interface TranslatedPage { // Keep translated content beside its English source; share the original layout. export const translatedPages: Record = { + // Home and showcase render inside the shared site layout alone. + '/': { + load: () => import('@/app/(detail)/page.ko'), + }, + '/showcase': { + load: () => import('@/app/(detail)/showcase/page.ko'), + }, '/docs/devup/figma-plugin': { load: () => import('@/app/(detail)/docs/devup/figma-plugin/page.ko.mdx'), Layout: DocsLayout, diff --git a/e2e/exported-routes.ts b/e2e/exported-routes.ts index 5b3935adb..2844fc68e 100644 --- a/e2e/exported-routes.ts +++ b/e2e/exported-routes.ts @@ -122,18 +122,20 @@ function walkFiles(directory: string): string[] { } /** - * The `/ko` routes with a Korean page: a `page.ko.mdx` beside the English - * one. Every other `/ko` route falls back to its English page. + * The `/ko` routes with a Korean page: a `page.ko.mdx` or `page.ko.tsx` + * beside the English one. Route groups and the dynamic `[component]` segment + * are not part of the URL. Every other `/ko` route falls back to its English + * page. */ export function getTranslatedRoutes(): string[] { const appRoot = resolve(process.cwd(), 'apps', 'landing', 'src', 'app') return walkFiles(appRoot) - .filter((path) => path.endsWith(`${sep}page.ko.mdx`)) + .filter((path) => /[\\/]page\.ko\.(?:mdx|tsx)$/u.test(path)) .map((path) => { const segments = relative(appRoot, path) .split(sep) .slice(0, -1) - .filter((segment) => !/^\(.*\)$/u.test(segment)) + .filter((segment) => !/^(?:\(.*\)|\[.*\])$/u.test(segment)) return ['/ko', ...segments].join('/') }) .sort() diff --git a/e2e/landing-dev.spec.ts b/e2e/landing-dev.spec.ts index f5a00604a..f3e4fc9ea 100644 --- a/e2e/landing-dev.spec.ts +++ b/e2e/landing-dev.spec.ts @@ -36,7 +36,7 @@ test.beforeEach(async ({ page }) => { const routes = [ ['/', '/'], ['/docs/overview', '/docs/overview'], - ['/ko', '/'], + ['/ko', '/ko'], ['/ko/docs/overview', '/ko/docs/overview'], ['/team', '/team'], ['/components/button', '/components/button'], diff --git a/e2e/landing-i18n.spec.ts b/e2e/landing-i18n.spec.ts index 3c1155b45..ead6f98fd 100644 --- a/e2e/landing-i18n.spec.ts +++ b/e2e/landing-i18n.spec.ts @@ -95,8 +95,9 @@ test('Korean routes render translated or English content without JavaScript', as await expect(page).toHaveURL(/(? { expect(width).toBeLessThanOrEqual(1024) } }) + +test('Korean home and showcase translate their copy and keep English unchanged', async ({ + page, +}) => { + await page.route('**/api.github.com/repos/dev-five-git/devup-ui', (route) => + route.fulfill({ + status: 200, + contentType: 'application/json', + body: JSON.stringify({ stargazers_count: 1234 }), + }), + ) + await page.setViewportSize({ width: 1920, height: 1080 }) + await page.goto('/') + await expect( + page.getByRole('heading', { name: 'Comparison Benchmarks' }), + ).toBeVisible() + await page.goto('/ko') + await expect(page.locator('html')).toHaveAttribute('lang', 'ko') + await expect(page.locator('link[rel="canonical"]')).toHaveAttribute( + 'href', + 'https://devup-ui.com/ko', + ) + await expect( + page.getByRole('heading', { name: '벤치마크 비교' }), + ).toBeVisible() + await expect(page.getByRole('heading', { name: '주요 기능' })).toBeVisible() + await expect( + page.getByRole('heading', { name: '커뮤니티에 참여하세요' }), + ).toBeVisible() + await page.getByRole('link', { name: '시작하기' }).click() + await expect(page).toHaveURL(/\/ko\/docs\/overview$/u) + + await page.goto('/ko/showcase') + await expect(page.locator('link[rel="canonical"]')).toHaveAttribute( + 'href', + 'https://devup-ui.com/ko/showcase', + ) + await expect(page.getByRole('heading', { name: '쇼케이스' })).toBeVisible() + await page.getByRole('button', { name: '모바일' }).click() + await expect(page.getByText('NH Allone Bank')).toBeVisible() + await expect(page.getByText('Braillify')).toHaveCount(0) +})