fix(i18n): complete phase 1 - translate section tags, replace lang checks, dedup download component

- Replace hardcoded SectionHeading tags with i18n strings (7 files)
- Replace 17 lang === 'vi' checks with useField/useFieldArray hooks
- Extract shared DownloadResumeDropdown component (Hero + DownloadResume)
- Move langLabels to src/data/resume.ts as resumeLanguageLabels
- Update feedback docs with resolution status
This commit is contained in:
dong.nguyen committed 2026-10-14 14:50:27 +07:00
1 parent 72a832c781
commit 4996a91a77
15 files changed
+489 -158

No files matched your search

+4 -3
View File
@@ -4,6 +4,7 @@ import { Tag } from '@/components/ui/Tag'
import { projects } from '@/data/projects'
import { useLanguage } from '@/hooks/useLanguage'
import { strings } from '@/i18n/strings'
import { useField } from '@/i18n/useField'
export function ProjectDetailPage() {
@@ -34,7 +35,7 @@ export function ProjectDetailPage() {
</div>
<p style={{ fontSize: '18px', color: 'var(--text-secondary)', marginBottom: '32px' }}>
{lang === 'vi' ? project.summary : project.summaryEn}
{useField(project.summary, project.summaryEn)}
</p>
{project.metrics && project.metrics.length > 0 && (
@@ -69,8 +70,8 @@ export function ProjectDetailPage() {
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>{strings.projectDetail.experiments[lang]}</h3>
{project.sections.map((section, idx) => (
<div key={idx} style={{ marginBottom: '16px', padding: '16px', background: 'var(--bg-surface)', borderRadius: '8px' }}>
<h4 style={{ fontSize: '14px', marginBottom: '4px', color: 'var(--text-primary)' }}>{lang === 'vi' ? section.title : section.titleEn}</h4>
<p style={{ fontSize: '14px', color: 'var(--text-secondary)' }}>{lang === 'vi' ? section.content : section.contentEn}</p>
<h4 style={{ fontSize: '14px', marginBottom: '4px', color: 'var(--text-primary)' }}>{useField(section.title, section.titleEn)}</h4>
<p style={{ fontSize: '14px', color: 'var(--text-secondary)' }}>{useField(section.content, section.contentEn)}</p>
<Tag accent>{section.type}</Tag>
</div>
))}