refactor(i18n): 사용자 문구 참조를 중앙화

This commit is contained in:
2026-03-10 13:32:37 +09:00
parent 92a509ebb6
commit 1717f335f0
44 changed files with 433 additions and 515 deletions

View File

@@ -4,6 +4,7 @@ import { useEffect, useMemo, useRef, useState, type FormEvent } from 'react';
import type { SceneAssetMap } from '@/entities/media';
import type { SceneTheme } from '@/entities/scene';
import type { GoalChip, SoundPreset, TimerPreset } from '@/entities/session';
import { copy } from '@/shared/i18n';
import { SceneSelectCarousel } from '@/features/scene-select';
import { SessionGoalField } from '@/features/session-goal';
import { Button } from '@/shared/ui';
@@ -84,6 +85,7 @@ export const SpaceSetupDrawerWidget = ({
onStart,
resumeHint,
}: SpaceSetupDrawerWidgetProps) => {
const { setup } = copy.space;
const [openPopover, setOpenPopover] = useState<RitualPopover | null>(null);
const panelRef = useRef<HTMLDivElement | null>(null);
@@ -95,7 +97,7 @@ export const SpaceSetupDrawerWidget = ({
return (
soundPresets.find((preset) => preset.id === selectedSoundPresetId)?.label ??
soundPresets[0]?.label ??
'기본'
copy.common.default
);
}, [selectedSoundPresetId, soundPresets]);
@@ -148,21 +150,21 @@ export const SpaceSetupDrawerWidget = ({
return (
<section
className="fixed left-1/2 top-1/2 z-40 w-[min(428px,92vw)] -translate-x-1/2 -translate-y-1/2"
aria-label="집중 시작 패널"
aria-label={setup.panelAriaLabel}
>
<div
ref={panelRef}
className="rounded-3xl border border-white/14 bg-[linear-gradient(160deg,rgba(15,23,42,0.68)_0%,rgba(8,13,27,0.56)_100%)] p-4 text-white shadow-[0_22px_52px_rgba(2,6,23,0.38)] backdrop-blur-2xl sm:p-5"
>
<header className="mb-3 space-y-1">
<p className="text-[10px] uppercase tracking-[0.18em] text-white/48">Ritual</p>
<h1 className="text-[1.45rem] font-semibold leading-tight text-white"> .</h1>
<p className="text-xs text-white/60"> HUD의 .</p>
<p className="text-[10px] uppercase tracking-[0.18em] text-white/48">{setup.eyebrow}</p>
<h1 className="text-[1.45rem] font-semibold leading-tight text-white">{setup.title}</h1>
<p className="text-xs text-white/60">{setup.description}</p>
</header>
{resumeHint ? (
<div className="mb-3 rounded-2xl border border-white/14 bg-black/22 px-3 py-2.5">
<p className="text-[11px] text-white/62"> </p>
<p className="text-[11px] text-white/62">{setup.resumeTitle}</p>
<p className="mt-1 truncate text-sm text-white/88">{resumeHint.goal}</p>
<div className="mt-2 flex items-center justify-end gap-1.5">
<button
@@ -170,14 +172,14 @@ export const SpaceSetupDrawerWidget = ({
onClick={resumeHint.onStartFresh}
className="rounded-full border border-white/16 bg-white/[0.04] px-2.5 py-1 text-[11px] text-white/72 transition-colors hover:bg-white/[0.1]"
>
{setup.startFresh}
</button>
<button
type="button"
onClick={resumeHint.onResume}
className="rounded-full border border-sky-200/34 bg-sky-200/14 px-2.5 py-1 text-[11px] text-white/90 transition-colors hover:bg-sky-200/22"
>
{setup.resumePrepare}
</button>
</div>
</div>
@@ -186,19 +188,19 @@ export const SpaceSetupDrawerWidget = ({
<div className="relative mb-3">
<div className="flex flex-wrap gap-1.5">
<SummaryChip
label="배경"
value={selectedScene?.name ?? '기본 배경'}
label={setup.sceneLabel}
value={selectedScene?.name ?? copy.common.defaultBackground}
open={openPopover === 'space'}
onClick={() => togglePopover('space')}
/>
<SummaryChip
label="타이머"
label={setup.timerLabel}
value={selectedTimerLabel}
open={openPopover === 'timer'}
onClick={() => togglePopover('timer')}
/>
<SummaryChip
label="사운드"
label={setup.soundLabel}
value={selectedSoundLabel}
open={openPopover === 'sound'}
onClick={() => togglePopover('sound')}
@@ -289,7 +291,7 @@ export const SpaceSetupDrawerWidget = ({
/>
<div className="space-y-1.5 pt-1">
{!canStart ? <p className="text-[10px] text-white/56"> .</p> : null}
{!canStart ? <p className="text-[10px] text-white/56">{setup.readyHint}</p> : null}
<Button
type="submit"
form="space-setup-ritual-form"
@@ -299,7 +301,7 @@ export const SpaceSetupDrawerWidget = ({
'h-10 rounded-xl !bg-sky-300/84 !text-slate-900 shadow-[0_8px_16px_rgba(125,211,252,0.24)] hover:!bg-sky-300 disabled:!bg-white/10 disabled:!text-white/42',
)}
>
{setup.openFocusScreen}
</Button>
</div>
</form>