Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions apps/landing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,15 @@ the existing components layout.
For home, showcase and components overview, add page.ko.tsx beside page.tsx and
register its pathname in src/i18n/pages.ts (home uses /). Translate the component
overview's Description.mdx as Description.ko.mdx beside it. Reuse the interactive
components. Introduce matching keys in src/i18n/messages/en.json and ko.json,
and load catalogs in src/i18n/request.ts, merging English defaults with Korean
overrides per namespace. In SiteLayout, pass getMessages({locale}) to
NextIntlClientProvider. Client components use useTranslations; server components
use getTranslations({locale}) from next-intl/server with an explicit locale.
These catalogs are introduced by the first TSX/shared-UI translation contribution;
the current provider has no translated UI messages. Keep state identifiers and
components. Shared UI copy lives in src/i18n/messages/en.json and ko.json, one
namespace per component; add matching keys to both. src/i18n/request.ts merges
the English defaults with the Korean overrides per namespace, and SiteLayout
passes getMessages({locale}) to NextIntlClientProvider. Client components use
useTranslations; server components use getTranslations({locale}) from
next-intl/server with an explicit locale. Keep state identifiers and
component/API names unchanged.

Shared navigation, search labels and footer belong to their own issue. Search
The shared header, sidebars, table of contents and search use these catalogs. Search
indexes are built by script.js: Korean MDX replaces its English entry, and other
entries stay English. Use Link and usePathname from @/i18n/navigation for internal
navigation; use next/link for static assets such as /storybook/index.html.
Expand Down
11 changes: 7 additions & 4 deletions apps/landing/src/app/(detail)/components/LeftMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
'use client'
import { VStack } from '@devup-ui/react'
import { useTranslations } from 'next-intl'

import { MenuItem } from '../docs/MenuItem'

export function LeftMenu() {
const t = useTranslations('ComponentsMenu')
return (
<VStack gap="6px">
<MenuItem to="/components/overview">Overview</MenuItem>
<MenuItem to="/components/overview">{t('overview')}</MenuItem>
<MenuItem
subMenu={[
{ to: '/components/button', children: 'Button' },
Expand All @@ -27,7 +30,7 @@ export function LeftMenu() {
{ to: '/components/label', children: 'Label' },
]}
>
Form
{t('form')}
</MenuItem>
<MenuItem
subMenu={[
Expand All @@ -41,12 +44,12 @@ export function LeftMenu() {
{ to: '/components/bottom-sheet', children: 'Bottom Sheet' },
]}
>
Layout
{t('layout')}
</MenuItem>
<MenuItem
subMenu={[{ to: '/components/theme-button', children: 'Theme Button' }]}
>
Theme
{t('theme')}
</MenuItem>
</VStack>
)
Expand Down
64 changes: 35 additions & 29 deletions apps/landing/src/app/(detail)/docs/LeftMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,48 +1,54 @@
'use client'
import { VStack } from '@devup-ui/react'
import { useTranslations } from 'next-intl'

import { MenuItem } from './MenuItem'

export function LeftMenu() {
const t = useTranslations('DocsMenu')
return (
<VStack gap="6px">
<MenuItem to="/docs/overview">Overview</MenuItem>
<MenuItem to="/docs/quick-start">Quick Start</MenuItem>
<MenuItem to="/docs/installation">Installation</MenuItem>
<MenuItem to="/docs/overview">{t('overview')}</MenuItem>
<MenuItem to="/docs/quick-start">{t('quickStart')}</MenuItem>
<MenuItem to="/docs/installation">{t('installation')}</MenuItem>
<MenuItem
subMenu={[
{ to: '/docs/core-concepts/zero-runtime', children: 'Zero Runtime' },
{
to: '/docs/core-concepts/zero-runtime',
children: t('zeroRuntime'),
},
{
to: '/docs/core-concepts/no-dependencies',
children: 'No Dependencies',
children: t('noDependencies'),
},
{
to: '/docs/core-concepts/style-storage',
children: 'Style Storage',
children: t('styleStorage'),
},
{
to: '/docs/core-concepts/type-inference-system',
children: 'Type Inference System',
children: t('typeInferenceSystem'),
},
{
to: '/docs/core-concepts/optimize-css',
children: 'Optimize CSS',
children: t('optimizeCss'),
},
{
to: '/docs/core-concepts/nm-base',
children: 'N/M Base',
children: t('nmBase'),
},
]}
>
Core Concepts
{t('coreConcepts')}
</MenuItem>
<MenuItem to="/docs/features">Features</MenuItem>
<MenuItem to="/docs/limitations">Supported Syntax & Limitations</MenuItem>
<MenuItem to="/docs/build-errors">Build Errors</MenuItem>
<MenuItem to="/docs/features">{t('features')}</MenuItem>
<MenuItem to="/docs/limitations">{t('limitations')}</MenuItem>
<MenuItem to="/docs/build-errors">{t('buildErrors')}</MenuItem>
<MenuItem
subMenu={[
{
to: '/docs/migration/overview',
children: 'Overview',
children: t('migrationOverview'),
},
{
to: '/docs/migration/styled-components',
Expand All @@ -62,21 +68,21 @@ export function LeftMenu() {
},
]}
>
Migration
{t('migration')}
</MenuItem>
<MenuItem
subMenu={[
{
to: '/docs/figma-and-theme-integration/devup-figma-plugin',
children: 'Devup Figma Plugin',
children: t('devupFigmaPlugin'),
},
{
to: '/docs/figma-and-theme-integration/devup-json',
children: 'devup.json Configuration',
children: t('devupJsonConfiguration'),
},
]}
>
Figma and Theme Integration
{t('figmaAndThemeIntegration')}
</MenuItem>
<MenuItem
subMenu={[
Expand Down Expand Up @@ -122,19 +128,19 @@ export function LeftMenu() {
},
{
to: '/docs/api/style-props',
children: 'Style Props',
children: t('styleProps'),
},
{
to: '/docs/api/custom-shorthands',
children: 'Custom Shorthands',
children: t('customShorthands'),
},
{
to: '/docs/api/selector',
children: 'Selector',
children: t('selector'),
},
{
to: '/docs/api/group-selector',
children: 'Group Selector',
children: t('groupSelector'),
},
]}
>
Expand All @@ -144,31 +150,31 @@ export function LeftMenu() {
subMenu={[
{
to: '/docs/devup/devup-json',
children: 'What is devup?',
children: t('whatIsDevup'),
},
{
to: '/docs/devup/colors',
children: 'Colors',
children: t('colors'),
},
{
to: '/docs/devup/typography',
children: 'Typography',
children: t('typography'),
},
{
to: '/docs/devup/length',
children: 'Length',
children: t('length'),
},
{
to: '/docs/devup/shadow',
children: 'Shadow',
children: t('shadow'),
},
{
to: '/docs/devup/breakpoints',
children: 'Breakpoints',
children: t('breakpoints'),
},
{
to: '/docs/devup/figma-plugin',
children: 'Figma Plugin',
children: t('figmaPlugin'),
},
]}
>
Expand Down
7 changes: 4 additions & 3 deletions apps/landing/src/app/(detail)/docs/RightIndex.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'
import { Box, css, Flex, Text, VStack } from '@devup-ui/react'
import { useLocale } from 'next-intl'
import { useLocale, useTranslations } from 'next-intl'
import { useEffect, useState } from 'react'

import { Link, usePathname } from '@/i18n/navigation'
Expand Down Expand Up @@ -42,6 +42,7 @@ function IndexMenu({
export function RightIndex() {
const pathname = usePathname()
const locale = useLocale()
const t = useTranslations('RightIndex')
const isDocs = pathname.startsWith('/docs/')
const isComponents = pathname.startsWith('/components/')
const editUrl = isDocs
Expand Down Expand Up @@ -100,7 +101,7 @@ export function RightIndex() {
<VStack>
<Flex alignItems="center" gap="10px" py="6px">
<Text color="$text" flex="1" typography="captionBold">
Contents
{t('contents')}
</Text>
</Flex>
{menus.map((menu) => (
Expand Down Expand Up @@ -130,7 +131,7 @@ export function RightIndex() {
textAlign="right"
typography="small"
>
Edit this page
{t('editThisPage')}
</Text>
<svg
aria-hidden="true"
Expand Down
5 changes: 4 additions & 1 deletion apps/landing/src/components/Header/HeaderInput.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
'use client'
import { Flex, Image, Input } from '@devup-ui/react'
import { useTranslations } from 'next-intl'

export function HeaderInput(props: React.ComponentProps<'input'>) {
const t = useTranslations('Header')
return (
<Flex
alignItems="center"
Expand All @@ -19,7 +22,7 @@ export function HeaderInput(props: React.ComponentProps<'input'>) {
border="none"
color="$text"
outline="none"
placeholder="Search documentation..."
placeholder={t('searchPlaceholder')}
typography="caption"
w="100%"
{...props}
Expand Down
11 changes: 7 additions & 4 deletions apps/landing/src/components/Header/MobMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Box, css, Flex, Text } from '@devup-ui/react'
import type { Locale } from 'next-intl'
import { getTranslations } from 'next-intl/server'

import { Link } from '@/i18n/navigation'

Expand All @@ -8,7 +10,8 @@ import { HeaderInput } from './HeaderInput'
import { HeaderInputWrap } from './HeaderInputWrap'
import { MobMenuWrap } from './MobMenuWrap'

export function MobMenu() {
export async function MobMenu({ locale }: { locale: Locale }) {
const t = await getTranslations({ locale, namespace: 'Header' })
return (
<MobMenuWrap>
<Box px={4} py={2.5}>
Expand All @@ -25,7 +28,7 @@ export function MobMenu() {
>
<Flex alignItems="center" py="10px">
<Text color="$title" textAlign="right" typography="buttonM">
Docs
{t('docs')}
</Text>
</Flex>
</Link>
Expand All @@ -38,7 +41,7 @@ export function MobMenu() {
>
<Flex alignItems="center" py="10px">
<Text color="$title" textAlign="right" typography="buttonM">
Components
{t('components')}
</Text>
</Flex>
</Link>
Expand All @@ -51,7 +54,7 @@ export function MobMenu() {
>
<Flex alignItems="center" py="10px">
<Text color="$title" textAlign="right" typography="buttonM">
Team
{t('team')}
</Text>
</Flex>
</Link>
Expand Down
4 changes: 3 additions & 1 deletion apps/landing/src/components/Header/MobMenuButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { css } from '@devup-ui/react'
import { useRouter } from 'next/navigation'
import { useTranslations } from 'next-intl'

import { replaceQuery, useQueryParam } from '@/utils/use-query-param'

Expand All @@ -10,12 +11,13 @@ interface MobMenuButtonProps {
}

export function MobMenuButton({ children }: MobMenuButtonProps) {
const t = useTranslations('Header')
const { replace } = useRouter()
const menu = useQueryParam('menu') === '1'
return (
<>
<svg
aria-label="Menu Button"
aria-label={t('menuButton')}
className={css({
color: '$text',
})}
Expand Down
4 changes: 3 additions & 1 deletion apps/landing/src/components/Header/ThemeSwitch.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
'use client'

import { Box, css, getTheme, setTheme } from '@devup-ui/react'
import { useTranslations } from 'next-intl'

export function ThemeSwitch() {
const t = useTranslations('Header')
return (
<Box
aria-label="Toggle color theme"
aria-label={t('toggleTheme')}
as="button"
bg="transparent"
border="0"
Expand Down
Loading
Loading