feat: Translate hardcoded English strings in Generate page #29

Closed
opened 2026-04-09 21:22:36 +00:00 by KnallerKalle · 1 comment
KnallerKalle commented 2026-04-09 21:22:36 +00:00 (Migrated from github.com)

Problem

The Generate page (src/app/[locale]/generate/page.tsx) has many hardcoded English strings:

  1. Template generation content (headings, instructions, tips)
  2. UI labels like 'Knowledge Base (Optional)', 'Loading knowledge base...', 'No knowledge entries available'
  3. Preview section text like 'Generated Lesson', 'AI Generated', 'Save to Library', 'Edit', 'Preview'
  4. Error messages like 'AI generation failed, using template instead'
  5. Placeholder text in empty state

Solution

Move all user-facing strings to i18n message files (src/messages/*.json).

Files Affected

  • src/app/[locale]/generate/page.tsx - Replace hardcoded strings
  • src/messages/en.json - Add generate.* translation keys
  • src/messages/de.json, fr.json, he.json, ru.json - Add translations
## Problem The Generate page (`src/app/[locale]/generate/page.tsx`) has many hardcoded English strings: 1. Template generation content (headings, instructions, tips) 2. UI labels like 'Knowledge Base (Optional)', 'Loading knowledge base...', 'No knowledge entries available' 3. Preview section text like 'Generated Lesson', 'AI Generated', 'Save to Library', 'Edit', 'Preview' 4. Error messages like 'AI generation failed, using template instead' 5. Placeholder text in empty state ## Solution Move all user-facing strings to i18n message files (`src/messages/*.json`). ## Files Affected - `src/app/[locale]/generate/page.tsx` - Replace hardcoded strings - `src/messages/en.json` - Add generate.* translation keys - `src/messages/de.json`, `fr.json`, `he.json`, `ru.json` - Add translations
KnallerKalle commented 2026-04-09 21:40:07 +00:00 (Migrated from github.com)

Fixed in commit 36f3b12

  • Replaced all hardcoded UI strings in generate page with t() calls
  • Added 22 new translation keys to generate namespace
  • Translated to all 5 languages (en, de, fr, ru, he)
  • Remaining hardcoded strings are AI prompts (not user-facing) and template generation (content strings)
  • Build passes, 27/27 tests passing
Fixed in commit 36f3b12 - Replaced all hardcoded UI strings in generate page with t() calls - Added 22 new translation keys to generate namespace - Translated to all 5 languages (en, de, fr, ru, he) - Remaining hardcoded strings are AI prompts (not user-facing) and template generation (content strings) - Build passes, 27/27 tests passing
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Kalle/ATM#29
No description provided.