Guidelines for translating narrative content into French while preserving literary style and integrating it into the codebase.
This skill guides you through translating the "Book Reader" content (data.js) into French. It emphasizes literary quality over literal translation and provides a workflow for integrating multilingual support.
"Traduisez le Ressenti, pas seulement les Mots." (Translate the Feeling, not just the Words.) The source material is a "Nordic Noir" style thriller (simulated Stieg Larsson). The French translation must reflect this cold, clinical, yet intense atmosphere (Polars Nordiques).
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_fr: "PREMIÈRE PARTIE : LE DÉFICIT", // [NEW]
content: "<p>...</p>",
content_fr: "<p>...</p>" // [NEW]
}
Logic Update:
Update logic.js to look for a language state.
const state = {
lang: 'en', // or 'fr'
// ...
};
// In renderChapter:
const title = state.lang === 'fr' ? chapter.title_fr : chapter.title;
const content = state.lang === 'fr' ? chapter.content_fr : 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 | French Translation | Note |
|---|---|---|---|
| "HelloTalk" | The App | HelloTalk | Keep English brand name usually, or "Application d'échange linguistique" |
| "Social Housing" | Setting | Logement social / HLM | Conveys lower economic status |
| "Polders" | Geography | Polders | Specific Dutch term, also used in French |
| "Apex Predator" | Metaphor | Superprédateur | Strength/Danger |