Files
maternal-app/maternal-web/locales/pt/auth.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

89 lines
3.0 KiB
JSON

{
"login": {
"title": "Welcome Back",
"subtitle": "Sign in to your account",
"email": "Email",
"password": "Password",
"rememberMe": "Remember me",
"forgotPassword": "Forgot password?",
"submit": "Sign In",
"noAccount": "Don't have an account?",
"signUp": "Sign up",
"or": "Or",
"continueWithGoogle": "Continue with Google",
"continueWithApple": "Continue with Apple",
"biometric": {
"useFaceId": "Use Face ID",
"useTouchId": "Use Touch ID",
"useFingerprint": "Use Fingerprint"
}
},
"signup": {
"title": "Create Account",
"subtitle": "Join Maternal today",
"name": "Full Name",
"email": "Email",
"password": "Password",
"confirmPassword": "Confirm Password",
"agreeToTerms": "I agree to the {{termsLink}} and {{privacyLink}}",
"termsOfService": "Terms of Service",
"privacyPolicy": "Privacy Policy",
"submit": "Create Account",
"hasAccount": "Already have an account?",
"signIn": "Sign in",
"or": "Or",
"continueWithGoogle": "Continue with Google",
"continueWithApple": "Continue with Apple"
},
"forgotPassword": {
"title": "Reset Password",
"subtitle": "Enter your email to receive a reset link",
"email": "Email",
"submit": "Send Reset Link",
"backToLogin": "Back to login",
"success": "Reset link sent! Check your email.",
"checkEmail": "We've sent a password reset link to {{email}}"
},
"resetPassword": {
"title": "Create New Password",
"subtitle": "Enter your new password",
"password": "New Password",
"confirmPassword": "Confirm Password",
"submit": "Reset Password",
"success": "Password reset successfully!",
"backToLogin": "Back to login"
},
"verification": {
"title": "Verify Your Email",
"subtitle": "We've sent a verification code to {{email}}",
"code": "Verification Code",
"submit": "Verify",
"resend": "Resend Code",
"resendIn": "Resend in {{seconds}}s",
"success": "Email verified successfully!",
"didNotReceive": "Didn't receive the code?"
},
"errors": {
"invalidEmail": "Please enter a valid email address",
"invalidPassword": "Password must be at least 8 characters",
"passwordMismatch": "Passwords do not match",
"emailRequired": "Email is required",
"passwordRequired": "Password is required",
"nameRequired": "Name is required",
"termsRequired": "You must agree to the terms and privacy policy",
"invalidCredentials": "Invalid email or password",
"emailExists": "An account with this email already exists",
"weakPassword": "Password is too weak. Please use a stronger password.",
"networkError": "Network error. Please try again.",
"unknownError": "An error occurred. Please try again."
},
"passwordRequirements": {
"title": "Password must contain:",
"minLength": "At least 8 characters",
"uppercase": "At least one uppercase letter",
"lowercase": "At least one lowercase letter",
"number": "At least one number",
"special": "At least one special character"
}
}