Files
maternal-app/maternal-web/locales/pt/ai.json
Andrei c1e37d30b0
Some checks failed
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled
feat: Implement frontend localization with i18n and measurement units
Implemented comprehensive frontend localization infrastructure supporting
5 languages (English, Spanish, French, Portuguese, Chinese) with measurement
unit preferences (Metric/Imperial). This lays the foundation for international
user support.

**Core Infrastructure:**
- Installed i18next, react-i18next, i18next-browser-languagedetector
- Created I18nProvider component integrated into app layout
- Configured i18next with language detection and localStorage persistence
- Created 35 translation files (5 languages × 7 namespaces)

**Translation Namespaces:**
- common: App-wide UI elements, navigation, actions
- tracking: Activity tracking (feeding, sleep, diaper, milestones)
- ai: AI assistant chat interface
- auth: Authentication flows (login, signup, password reset)
- settings: Settings and preferences
- onboarding: Onboarding flow
- errors: Error messages and validation

**Custom Hooks:**
- useTranslation: Type-safe translation wrapper
- useLocale: Language and measurement system management
- useFormatting: Date, time, number, and unit formatting

**Measurement Unit Support:**
- Created unit conversion utilities (weight, height, temperature, volume)
- Metric: kg, cm, °C, ml
- Imperial: lb, in, °F, oz
- Bidirectional conversion functions

**UI Components:**
- LanguageSelector: Dropdown to change app language
- MeasurementUnitSelector: Toggle between Metric/Imperial
- Integrated both into Settings page Preferences section

**Next Steps (Remaining):**
- Add measurement preferences to backend user schema
- Create onboarding flow with language/measurement selection
- Apply translations to existing components (dashboard, tracking forms)
- Implement multi-language AI responses
- Add professional translations (currently using basic translations)

**File Highlights:**
- lib/i18n/config.ts: i18next configuration
- hooks/useFormatting.ts: Formatting utilities with locale support
- lib/utils/unitConversion.ts: Unit conversion logic
- components/settings/*Selector.tsx: Language and measurement selectors
- locales/*/: Translation files for 5 languages

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 10:52:38 +00:00

63 lines
2.1 KiB
JSON

{
"title": "AI Assistant",
"subtitle": "24/7 Parenting Support",
"chat": {
"placeholder": "Ask me anything about parenting...",
"send": "Send",
"listening": "Listening...",
"processing": "Processing...",
"thinking": "Thinking...",
"typing": "AI is typing...",
"voiceInput": "Voice Input",
"textInput": "Text Input",
"newChat": "New Chat",
"clearChat": "Clear Chat",
"confirmClear": "Are you sure you want to clear this chat?",
"noMessages": "No messages yet",
"startConversation": "Start a conversation with your AI assistant"
},
"suggestions": {
"title": "Suggested Questions",
"sleepPattern": "How can I improve my baby's sleep pattern?",
"feeding": "How much should my baby be eating?",
"development": "What milestones should I expect this month?",
"health": "When should I be concerned about a fever?"
},
"context": {
"analyzing": "Analyzing your child's patterns...",
"usingRecent": "Using recent activity data",
"basedOn": "Based on {{childName}}'s profile"
},
"disclaimer": {
"title": "Important Disclaimer",
"message": "This AI assistant provides general parenting guidance and is not a substitute for professional medical advice. Always consult with your pediatrician for medical concerns.",
"emergency": "In case of emergency, call emergency services immediately.",
"understand": "I Understand"
},
"limits": {
"dailyLimit": "Daily question limit reached",
"dailyLimitMessage": "You've reached your daily limit of {{limit}} questions. Upgrade to premium for unlimited access.",
"upgrade": "Upgrade to Premium"
},
"history": {
"title": "Chat History",
"today": "Today",
"yesterday": "Yesterday",
"thisWeek": "This Week",
"older": "Older",
"noHistory": "No chat history",
"delete": "Delete Chat",
"confirmDelete": "Are you sure you want to delete this chat?"
},
"topics": {
"sleep": "Sleep",
"feeding": "Feeding",
"development": "Development",
"health": "Health",
"behavior": "Behavior",
"safety": "Safety",
"nutrition": "Nutrition",
"general": "General"
}
}