feat(V2-1d): packages/i18n 추출 — Electron 독립 i18n 엔진

packages/i18n (@d3ro/i18n) 신규:
- src/locales/ 12개 JSON (ko/en/ja/zh/zh-TW/es/fr/de/pt/ru/vi/th)
- src/index.tsx: TFunction/Locale/LOCALE_META/resolveTranslation/
  포맷 유틸(createFormatDate/Number/RelativeDate/Time)/
  I18nContext/useI18n/I18nProvider

Electron 독립성 확보 (monorepo 원칙 준수):
- I18nStorage interface 신설 (load/save 어댑터 추상화)
- window.electronAPI.config 직접 호출 제거
- I18nProvider는 storage prop으로 영속화 어댑터 주입
- 기본값 noopStorage (메모리 한정, 세션 범위)
- 결과: packages/i18n은 React에만 의존, web/mobile에서 재사용 가능

apps/desktop 어댑터:
- App.tsx에 electronI18nStorage 구현 (config.get/set 래핑)
- <I18nProvider storage={electronI18nStorage}>로 주입

apps/desktop 설정:
- package.json: @d3ro/i18n '*' dep 추가
- tsconfig.node/web.json paths에 @d3ro/i18n 추가
- electron.vite.config.ts alias + externalize exclude 추가
- vitest.config.ts alias 추가

일괄 치환 (29 파일):
- ./i18n, ../i18n, ../../i18n → @d3ro/i18n

apps/desktop/src/renderer/i18n/ 디렉토리 완전 제거.

검증: typecheck + build + dev 런타임 모두 통과.
Phase V2-1 전체 완료 (a/b/c/d).
This commit is contained in:
yunchan8804 2026-04-08 14:57:27 +09:00
parent a041f1b6a9
commit 3524e958ba
51 changed files with 175 additions and 66 deletions

View file

@ -15,7 +15,7 @@ import { MetalCard } from '@d3ro/ui/components/ds'
import { PhosphorText } from '@d3ro/ui/components/ds'
import { PhysicalButton } from '@d3ro/ui/components/ds'
import { d3roPalette, d3roTypo, d3roRadius, d3roShadow } from '@d3ro/ui/theme'
import { useI18n } from '../../i18n'
import { useI18n } from '@d3ro/i18n'
interface TemplateItem {
id: string

View file

@ -8,7 +8,7 @@ import { MarkdownEditor } from './MarkdownEditor'
import { ExportMenu } from './ExportMenu'
import { PhysicalButton } from '@d3ro/ui/components/ds'
import { d3roPalette, d3roTypo } from '@d3ro/ui/theme'
import { useI18n } from '../../i18n'
import { useI18n } from '@d3ro/i18n'
import type { MeetingExportFormat } from '@d3ro/core/types'
interface DocumentTabDoc {

View file

@ -4,7 +4,7 @@
import { useState, useRef, useCallback } from 'react'
import { Box, TextField, Tooltip, Chip } from '@mui/material'
import { d3roPalette, d3roFontMono } from '@d3ro/ui/theme'
import { useI18n } from '../../i18n'
import { useI18n } from '@d3ro/i18n'
// Phase 15.5: 화자별 색상 매핑 (d3roPalette SSOT)
const SPEAKER_COLORS = [

View file

@ -6,7 +6,7 @@ import { Menu, MenuItem } from '@mui/material'
import FileDownloadIcon from '@mui/icons-material/FileDownload'
import { PhysicalButton } from '@d3ro/ui/components/ds'
import { d3roPalette, d3roTypo, d3roFontMono, d3roRadius, d3roShadow } from '@d3ro/ui/theme'
import { useI18n } from '../../i18n'
import { useI18n } from '@d3ro/i18n'
import type { MeetingExportFormat } from '@d3ro/core/types'
interface ExportMenuProps {

View file

@ -6,7 +6,7 @@ import { Box } from '@mui/material'
import { MarkdownRenderer } from './MarkdownRenderer'
import { PhysicalButton } from '@d3ro/ui/components/ds'
import { d3roPalette, d3roFontMono, d3roTypo, d3roShadow, d3roRadius } from '@d3ro/ui/theme'
import { useI18n } from '../../i18n'
import { useI18n } from '@d3ro/i18n'
interface MarkdownEditorProps {
content: string

View file

@ -10,7 +10,7 @@ import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
import { PhosphorText } from '@d3ro/ui/components/ds'
import { PhysicalButton } from '@d3ro/ui/components/ds'
import { d3roPalette, d3roFontMono, d3roTypo, d3roShadow } from '@d3ro/ui/theme'
import { useI18n } from '../../i18n'
import { useI18n } from '@d3ro/i18n'
import type { MeetingChatMessage } from '@d3ro/core/types'
interface MeetingChatPanelProps {

View file

@ -20,7 +20,7 @@ import { AddDocumentDialog } from './AddDocumentDialog'
import { MeetingChatPanel } from './MeetingChatPanel'
import { PhosphorText } from '@d3ro/ui/components/ds'
import { d3roPalette, d3roFontMono, d3roTypo } from '@d3ro/ui/theme'
import { useI18n } from '../../i18n'
import { useI18n } from '@d3ro/i18n'
import type {
MeetingSessionDetail,
MeetingDocument,

View file

@ -7,7 +7,7 @@ import { EditableSegment } from './EditableSegment'
import { PhysicalButton } from '@d3ro/ui/components/ds'
import { PhosphorText } from '@d3ro/ui/components/ds'
import { d3roPalette, d3roFontMono, d3roTypo } from '@d3ro/ui/theme'
import { useI18n } from '../../i18n'
import { useI18n } from '@d3ro/i18n'
import FileDownloadIcon from '@mui/icons-material/FileDownload'
import AutoFixHighIcon from '@mui/icons-material/AutoFixHigh'
import RecordVoiceOverIcon from '@mui/icons-material/RecordVoiceOver'