Files
maternal-app/maternal-web/locales/en/children.json
Andrei b56f9546c2 feat: Complete high-priority i18n localization with date/time support
This commit implements comprehensive localization for high-priority components:

## Tracking Pages (4 files)
- Localized feeding, sleep, diaper, and medicine tracking pages
- Replaced hardcoded strings with translation keys from tracking namespace
- Added useTranslation hook integration
- All form labels, buttons, and messages now support multiple languages

## Child Dialog Components (2 files)
- Localized ChildDialog (add/edit child form)
- Localized DeleteConfirmDialog
- Added new translation keys to children.json for dialog content
- Includes validation messages and action buttons

## Date/Time Localization (14 files + new hook)
- Created useLocalizedDate hook wrapping date-fns with locale support
- Supports 5 languages: English, Spanish, French, Portuguese, Chinese
- Updated all date formatting across:
  * Tracking pages (feeding, sleep, diaper, medicine)
  * Activity pages (activities, history, track activity)
  * Settings components (sessions, biometric, device trust)
  * Analytics components (insights, growth, sleep chart, feeding graph)
- Date displays automatically adapt to user's language (e.g., "2 hours ago" → "hace 2 horas")

## Translation Updates
- Enhanced children.json with dialog section containing:
  * Form field labels (name, birthDate, gender, photoUrl)
  * Action buttons (add, update, delete, cancel, saving, deleting)
  * Delete confirmation messages
  * Validation error messages

Files changed: 17 files (+164, -113)
Languages supported: en, es, fr, pt-BR, zh-CN

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 11:49:48 +00:00

51 lines
1.5 KiB
JSON

{
"title": "Children",
"subtitle": "Manage your family's children profiles",
"addChild": "Add Child",
"addFirstChild": "Add First Child",
"editChild": "Edit Child",
"deleteChild": "Delete Child",
"noChildren": "No children added yet",
"noChildrenSubtitle": "Add your first child to start tracking their activities",
"age": "Age",
"gender": {
"male": "Male",
"female": "Female",
"other": "Other"
},
"dialog": {
"name": "Name",
"birthDate": "Birth Date",
"gender": "Gender",
"photoUrl": "Photo URL (Optional)",
"photoPlaceholder": "https://example.com/photo.jpg",
"cancel": "Cancel",
"add": "Add",
"update": "Update",
"saving": "Saving...",
"delete": "Delete",
"deleting": "Deleting...",
"confirmDelete": "Confirm Delete",
"confirmDeleteMessage": "Are you sure you want to delete",
"confirmDeleteWarning": "This action cannot be undone. All associated data will be permanently removed.",
"validation": {
"nameRequired": "Please enter a name",
"birthDateRequired": "Please select a birth date",
"birthDateFuture": "Birth date cannot be in the future"
}
},
"errors": {
"noFamily": "No family found. Please complete onboarding first.",
"loadFailed": "Failed to load children",
"saveFailed": "Failed to save child",
"deleteFailed": "Failed to delete child",
"noFamilyId": "No family ID found"
},
"ageFormat": {
"year": "year",
"years": "years",
"month": "month",
"months": "months"
}
}