refactor(i18n): split content into structure JSON and per-language dictionaries

Phase 1 of spec-v4-live-edit: data/i18n foundation, no visible feature.

- src/data/{profile,skills,experience,projects}.json: language-neutral
  structure documents with thin typed loaders; all prose moved to
  src/i18n/locales/{vi,en}/content.json; chrome strings to ui.json
- src/i18n/: dict-types, cross-document validator (runs at module load and
  via pnpm validate:content), loader joining structure+text once (UI/CONTENT),
  I18nProvider/useI18n mounted in App under LanguageProvider
- all 22 consumers read joined records via useI18n(); field.ts and
  strings.ts deleted; *En field pairs removed from the domain types
- hero tagline renders as plain-text segments (D9); philosophy quotes as
  paragraph arrays; footer display name now localizes per language (D6)
- resume generator consumes UI/CONTENT; generated resume HTML verified
  byte-identical (EN+VI) before/after the migration
- AGENTS.md and v3/v3-i18n + v4 specs updated; deploy.yml concurrency group
This commit is contained in:
dong.nguyen committed 2026-10-22 07:29:06 +07:00
1 parent f5687cce1c
commit e6b4d83084
50 files changed
+2215 -961

No files matched your search

+29 -72
View File
@@ -12,78 +12,35 @@ export type ProjectCategory =
| "architecture"
| "experiment";
export interface Project {
id: string;
title: string;
titleEn?: string;
summary: string;
summaryEn?: string;
category: ProjectCategory;
role: string;
technologies: string[];
metrics?: string[];
featured: boolean;
}
// Stable id unions (spec-v4 §3.1). Text dictionaries are type-safe only against
// closed unions: adding a content item means adding a union member, a structure
// record, and its Vietnamese text — tsc catches a missing text entry, the
// validator (src/i18n/validate.ts) catches id mismatches across documents.
// SkillGroupId and PhilosophyId are internal keys and never appear in URLs.
export type ProjectId =
| 'iot-dws-integration'
| 'awb-detection'
| 'facility-management'
| 'local-llm-experiments';
export interface ProjectSection {
id: string;
title: string;
titleEn?: string;
content: string;
contentEn?: string;
type: "text" | "diagram" | "metrics" | "code";
}
export type ExperienceId =
| 'open-to-work'
| 'relax-gap'
| 'lazada-senior-swe'
| 'nexts-founder'
| 'sap-senior-swe';
export interface ProjectDetail extends Project {
sections: ProjectSection[];
}
export type SkillGroupId =
| 'software-engineering'
| 'system-architecture'
| 'logistics-technology'
| 'ai-ml'
| 'infrastructure'
| 'engineering-practices';
export interface ExperienceEntry {
id: string;
title: string;
titleEn?: string;
company: string;
duration: string;
location?: string;
responsibilities: string[];
responsibilitiesEn?: string[];
variant?: 'current' | 'gap';
logo?: string;
}
export interface SkillGroup {
title: string;
titleEn?: string;
skills: string[];
}
export interface PhilosophyPoint {
title: string;
titleEn?: string;
description: string;
descriptionEn?: string;
keywords: string[];
}
export interface Profile {
name: string;
nameEn: string;
firstName: string;
lastName: string;
title: string;
titleEn?: string;
tagline: string;
taglineEn?: string;
bio: string;
bioEn?: string;
email: string;
githubUrl: string;
linkedinUrl: string;
githubHandle: string;
linkedinHandle: string;
telegramUrl: string;
telegramHandle: string;
currentInterests: string[];
roles: string[];
philosophy: PhilosophyPoint[];
}
export type PhilosophyId =
| 'build-for-the-real-problem'
| 'think-in-systems'
| 'measure-impact'
| 'keep-learning'
| 'business-domain-knowledge-is-a-key-of-success';