Guidelines for translating narrative content into Chinese while preserving literary style and integrating it into the codebase.
This skill guides you through translating the "Book Reader" content (data.js) into Chinese. It emphasizes literary quality over literal translation and provides a workflow for integrating multilingual support.
"Translate the Feeling, not just the Words." The source material is a "Nordic Noir" style thriller (simulated Stieg Larsson). The Chinese translation must reflect this cold, clinical, yet intense atmosphere.
Tone Guidelines:
Use this to structurally prepare the codebase for translation.
Schema Update:
Modify src/features/reader/data.js to support dual fields.
{
chapter: 1,
title: "PART I: THE DEFICIT",
title_cn: "第一部:赤字", // [NEW]
content: "<p>...</p>",
content_cn: "<p>...</p>" // [NEW]
}
Logic Update:
Update logic.js to look for a language state.
const state = {
lang: 'en', // or 'cn'
// ...
};
// In renderChapter:
const title = state.lang === 'cn' ? chapter.title_cn : chapter.title;
const content = state.lang === 'cn' ? chapter.content_cn : chapter.content;
UI Update: Add a language toggle in the Settings Drawer.
Use this when generating the content.
Novel.txt or data.js chunk by chunk.<p>) is preserved.| English Term | Context | Chinese Translation | Note |
|---|---|---|---|
| "HelloTalk" | The App | HelloTalk | Keep English brand name usually, or "语言学习APP" |
| "Social Housing" | Setting | 廉租房 / 社会福利房 | Conveys lower economic status |
| "Polders" | Geography | 围垦地 / 圩田 | Specific Dutch term |
| "Apex Predator" | Metaphor | 顶级掠食者 | Strength/Danger |