Internationalization
Overview
Section titled “Overview”PinTeach uses react-i18next for all user-facing strings. No hardcoded strings in components.
- Primary language: Spanish (ES)
- Secondary language: English (EN)
- Total keys: 5,400+
import { useTranslation } from 'react-i18next';
function MyComponent() { const { t } = useTranslation();
return ( <div> <h1>{t('reviews.title')}</h1> <p>{t('sessions.count', { count: 5 })}</p> <button>{t('common.save')}</button> </div> );}Key Namespaces
Section titled “Key Namespaces”| Prefix | Area |
|---|---|
common.* |
Shared (save, cancel, delete, loading, error) |
nav.* |
Navigation labels |
dashboard.* |
Dashboard KPIs and actions |
calendar.* |
Calendar views and events |
sessions.* |
Session management |
students.* |
Student CRM |
services.* |
Service management |
payments.* |
Payment history and KPIs |
reviews.* |
Review system |
materials.* |
Materials browser |
widgets.* |
Widget configuration |
settings.* |
Settings pages |
shortcuts.* |
Keyboard shortcuts (55+ keys) |
profile.* |
Teacher profile |
auth.* |
Login and verification |
onboarding.* |
Onboarding wizard |
privacy.* |
GDPR and data management |
- Every user-facing string must use
t()— no hardcoded strings - Both ES and EN translations are required for every key
- Use interpolation for dynamic values:
t('key', { name: 'Maria' }) - Use pluralization:
t('key', { count: n })with_one/_othersuffixes - Keyboard shortcut labels use
shortcuts.*namespace
Configuration
Section titled “Configuration”Setup in apps/app/src/lib/i18n.ts:
import i18n from 'i18next';import { initReactI18next } from 'react-i18next';
i18n.use(initReactI18next).init({ lng: 'es', // Spanish primary fallbackLng: 'en', interpolation: { escapeValue: false }, resources: { es, en },});