-
Notifications
You must be signed in to change notification settings - Fork 0
Description
๐ฏ Issue Type
- โจ Feature - New functionality
- ๐ง Enhancement - Improvement of existing functionality
๐ Description
Problem/Need
GitRay currently only supports German text hardcoded in components. To reach international users and improve accessibility, we need multi-language support for 7-10 languages with automatic detection and user preference persistence.
Expected Behavior
- Support for 7-10 languages (starting with DE + EN)
- Language selector in Settings drawer
- Automatic browser language detection
- User language preference persists across sessions
- All UI text properly translated (no hardcoded strings)
- Pluralization support (e.g., "1 commit" vs "5 commits")
- Language-specific date/number formatting
- TypeScript type safety for translation keys
Current Behavior
- All text hardcoded in German/English mix
- No language switching capability
- No internationalization framework
๐ Steps to Reproduce
This is a feature implementation. To test completion:
- Clone branch
feature/i18n-implementation - Run
npm installandnpm run dev - Open Settings drawer โ verify language selector visible
- Switch between languages โ verify all text updates
- Reload page โ verify language preference persists
- Test browser language detection (change browser language)
- Test pluralization with different counts
- Verify date formatting changes per language
- Check for any untranslated strings (hardcoded text)
๐จ Mockups/Screenshots
Language selector in Settings drawer:
Settings
โโโ Theme: [Light | Dark | System]
โโโ Language: [๐ฉ๐ช Deutsch | ๐ฌ๐ง English | ๐ช๐ธ Espaรฑol | ...]
Translation file structure:
{
"header.menu": "Menรผ",
"landing.hero.title": "Analysiere dein Repository",
"dashboard.heatmap.commits": "{{count}} Commit",
"dashboard.heatmap.commits_plural": "{{count}} Commits"
}๐งช Acceptance Criteria
- react-i18next installed and configured
- Translation file structure created (de, en, es, fr, it, pt, pl, nl, ja)
- Language selector added to Settings drawer
- All components updated to use
t()function (no hardcoded strings) - Automatic browser language detection working
- Language preference persists in localStorage
- Pluralization working correctly
- Date/number formatting respects selected language
- TypeScript types for translation keys working
- German + English translations complete and reviewed
- Additional 5-8 languages added (at least structure)
- No translation keys visible in UI (all resolved)
- Tests updated for i18n (component rendering in multiple languages)
- Bundle size increase < 50KB
- Documentation updated with translation workflow
- Code reviewed and approved
๐ Technical Details
Affected Files/Components
New Files:
src/i18n/
โโโ config.ts # i18next configuration
โโโ types.ts # TypeScript type definitions
public/locales/
โโโ de/
โ โโโ common.json # Header, Footer, Settings, Toasts
โ โโโ landing.json # Landing page specific
โ โโโ dashboard.json # Dashboard specific
โโโ en/
โ โโโ common.json
โ โโโ landing.json
โ โโโ dashboard.json
โโโ [es, fr, it, pt, pl, nl, ja]/
Updated Components (add useTranslation hook):
Header.tsx- Menu, news, signOut buttonsFooter.tsx- LinksSettingsDrawer.tsx- Add language selector, translate theme labelsLandingPage.tsx- Hero, buttons, placeholdersDashboardPage.tsx- Tab labelsActivityHeatmap.tsx- Filter labels, commit countsCommitList.tsx- Column headersInfoModal.tsx- Modal contentNewsDrawer.tsx- News titlesApp.tsx- Toast messages
Updated Files:
main.tsx- Import i18n config before App
Dependencies
New packages:
npm install i18next react-i18next i18next-browser-languagedetector
# Optional for better performance:
npm install i18next-http-backendDepends on:
- #[ui-migration-issue-number] - MUST be completed and merged first
- All UI components must exist before adding translations
Blocks:
- Nothing
Breaking Changes
- No, backward compatible change
- New feature, doesn't affect existing functionality
๐ท Categorization
Scope
-
scope:frontend- Frontend/UI changes
Priority
-
prio:high- Important feature
Effort
-
effort:medium- 2-8 hours (2 days estimated)
๐ Environment
Development:
- OS: Cross-platform (Windows, macOS, Linux)
- Browser: Chrome 120+, Firefox 121+, Safari 17+
- Node Version: 18+ required
- Repo Branch:
feature/i18n-implementation(create frommainAFTER UI migration merged)
๐ Related Issues/PRs
- Blocked by: #[ui-migration-issue-number] - UI Migration (MUST be merged first)
- Relates to: Accessibility improvements
๐ Additional Notes
Target Languages & Rollout
Phase 1: MVP (Week 1)
- ๐ฉ๐ช German (Deutsch) - Professional translation
- ๐ฌ๐ง English - Professional translation
Phase 2: European Expansion (Week 2-3)
- ๐ช๐ธ Spanish (Espaรฑol)
- ๐ซ๐ท French (Franรงais)
- ๐ฎ๐น Italian (Italiano)
- ๐ต๐น Portuguese (Portuguรชs)
Phase 3: Global (Week 4+)
- ๐ต๐ฑ Polish (Polski)
- ๐ณ๐ฑ Dutch (Nederlands)
- ๐ฏ๐ต Japanese (ๆฅๆฌ่ช)
- ๐จ๐ณ Chinese (ไธญๆ) - Optional
Implementation Timeline (2 days)
Day 1 (Morning): Setup, install dependencies, create folder structure, i18n config, TypeScript types
Day 1 (Afternoon): Create English + German translation files, update first components (Header, Footer, Landing)
Day 2 (Morning): Update remaining components (Dashboard, Heatmap, Lists), add language selector
Day 2 (Afternoon): Add remaining language structures, testing, documentation
Week 2+: Professional translation review, community translations for additional languages
Translation Strategy (Cost-Effective Hybrid Approach)
Recommended: Hybrid Approach
- Core languages (DE, EN): Professional translation (โฌ600-1,200)
- Additional languages: DeepL API + native speaker review
- Total cost: โฌ800-1,500
- Quality: Good to very high
- Scalable: Yes โ
Alternatives:
- DIY: ~40 hours developer time, variable quality
- Full Professional: โฌ2,100-โฌ4,200 (7 languages), highest quality
Content Volume
- ~90 translation keys per language
- ~500 words per language
- Total for 7 languages: ~3,500 words
Documentation
Complete i18n implementation guide available:
docs/migration-plan/I18N_IMPLEMENTATION.md- Full guide (30 pages)- Translation file templates
- Component update examples
- Maintenance workflow
- Adding new languages process
Key Technical Decisions
Why react-i18next?
- Industry standard (11k+ stars)
- Small bundle size (12KB vs 45KB for react-intl)
- Perfect TypeScript support
- Built-in lazy loading
- Excellent Vite support
Namespace Organization:
common.json- Used everywhere (header, footer, toasts)landing.json- Landing page specificdashboard.json- Dashboard specific- Benefit: Code splitting, better performance
Key Naming Convention:
{
"section.component.element": "Text",
"header.menu": "Menรผ",
"landing.hero.title": "Analysiere dein Repository"
}Performance Impact
- Initial bundle increase: ~30KB (with lazy loading)
- Language files load on demand
- Minimal impact on app performance
- All languages cached in localStorage
Maintenance Workflow
- Add new text to English files first (source of truth)
- Copy structure to other language files
- Translate or mark as TODO
- Test in all languages
- Quarterly audit for completeness
Testing Strategy
- Component tests with multiple languages
- Language switching tests
- Pluralization tests
- Date formatting tests
- Translation key existence tests
- No hardcoded strings validation
โ Checklist for Reviewer
- Issue is clearly and understandably formulated
- Acceptance criteria are measurable
- Labels and priority are set
- Technical feasibility is given
- UI Migration is completed and merged (hard requirement)
- Dependencies listed and installable
- Timeline is realistic (2 days confirmed)
- Translation strategy decided (DIY/Professional/Hybrid)
- Budget approved for translations (if using professional)
- Documentation linked and accessible