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>
100 lines
3.0 KiB
JSON
100 lines
3.0 KiB
JSON
{
|
|
"welcome": {
|
|
"title": "Welcome to Maternal",
|
|
"subtitle": "Your AI-powered child care assistant",
|
|
"description": "Track activities, get AI-powered insights, and coordinate with your family—all in one place.",
|
|
"getStarted": "Get Started",
|
|
"skip": "Skip"
|
|
},
|
|
"language": {
|
|
"title": "Choose Your Language",
|
|
"subtitle": "Select your preferred language",
|
|
"description": "You can change this later in settings"
|
|
},
|
|
"measurements": {
|
|
"title": "Measurement Units",
|
|
"subtitle": "Choose your preferred unit system",
|
|
"description": "Select the measurement system you're most comfortable with. You can change this later in settings.",
|
|
"metric": {
|
|
"title": "Metric",
|
|
"description": "Kilograms, centimeters, Celsius, milliliters"
|
|
},
|
|
"imperial": {
|
|
"title": "Imperial",
|
|
"description": "Pounds, inches, Fahrenheit, ounces"
|
|
}
|
|
},
|
|
"profile": {
|
|
"title": "Create Your Profile",
|
|
"subtitle": "Tell us about yourself",
|
|
"name": "Your Name",
|
|
"email": "Email Address",
|
|
"password": "Password",
|
|
"confirmPassword": "Confirm Password",
|
|
"relation": "Relation to Child",
|
|
"relations": {
|
|
"mother": "Mother",
|
|
"father": "Father",
|
|
"guardian": "Guardian",
|
|
"caregiver": "Caregiver",
|
|
"other": "Other"
|
|
}
|
|
},
|
|
"child": {
|
|
"title": "Add Your Child",
|
|
"subtitle": "Let's start with your first child",
|
|
"name": "Child's Name",
|
|
"dateOfBirth": "Date of Birth",
|
|
"gender": "Gender",
|
|
"genders": {
|
|
"male": "Male",
|
|
"female": "Female",
|
|
"other": "Other",
|
|
"preferNotToSay": "Prefer not to say"
|
|
},
|
|
"weight": "Current Weight",
|
|
"height": "Current Height",
|
|
"addAnother": "Add Another Child",
|
|
"skipForNow": "Skip for Now"
|
|
},
|
|
"family": {
|
|
"title": "Invite Family Members",
|
|
"subtitle": "Coordinate with your family",
|
|
"description": "Invite family members to view and track activities together. They'll receive an email invitation.",
|
|
"email": "Family Member's Email",
|
|
"role": "Role",
|
|
"roles": {
|
|
"parent": "Parent",
|
|
"caregiver": "Caregiver",
|
|
"viewer": "Viewer"
|
|
},
|
|
"addMember": "Add Member",
|
|
"inviteLater": "I'll Invite Later"
|
|
},
|
|
"notifications": {
|
|
"title": "Enable Notifications",
|
|
"subtitle": "Stay informed",
|
|
"description": "Get reminders for feedings, sleep times, and important milestones.",
|
|
"push": "Push Notifications",
|
|
"email": "Email Notifications",
|
|
"enable": "Enable Notifications",
|
|
"skipForNow": "Skip for Now"
|
|
},
|
|
"complete": {
|
|
"title": "All Set!",
|
|
"subtitle": "You're ready to start tracking",
|
|
"description": "Start tracking your child's activities and get personalized AI-powered insights.",
|
|
"startTracking": "Start Tracking",
|
|
"exploreDashboard": "Explore Dashboard"
|
|
},
|
|
"navigation": {
|
|
"next": "Next",
|
|
"back": "Back",
|
|
"skip": "Skip",
|
|
"finish": "Finish"
|
|
},
|
|
"progress": {
|
|
"step": "Step {{current}} of {{total}}"
|
|
}
|
|
}
|