enhancementgood first issuei18nperformance
Repository metrics
- Stars
- (35 stars)
- PR merge metrics
- (PR metrics pending)
Description
Context
Part of the i18n feature implementation (branch: 004-add-internationalization-i18n).
Parent Work: Core i18n infrastructure complete in PR #383 + follow-up commits Priority: P3 (Nice to have for v1.2.0) Work Package: WP08 Depends On: #465 (WP07) can be done independently
Goal
Language selection UI component with localStorage persistence, performance optimization, and SEO enhancements.
Acceptance Criteria
- Language switcher appears in navigation with all 15 languages
- Selecting a language persists across sessions
- Page load time is within 100ms of English baseline
- Sitemap includes hreflang for SEO
Subtasks
- T035: Create
website/src/components/LanguageSwitcher.astrowith dropdown of all 15 languages - T036: Add client-side localStorage persistence logic
- T037: Performance optimization - verify lazy loading of translations
- T038: Add hreflang sitemap to
public/sitemap.xmlfor SEO
Implementation Notes
-
LanguageSwitcher component:
- Display native language names (e.g., "Español", "日本語", "עברית")
- Current language highlighted/selected
- On change: redirect to corresponding locale URL
- Use client-side script tag for interactivity
-
localStorage persistence:
- Save as
caroPreferredLanguage - On page load, check and redirect if different
- Respect manual URL navigation
- Save as
-
Performance:
- Verify Astro's code splitting works
- Measure with Lighthouse for baseline comparison
-
SEO:
- Generate sitemap with all locale URLs
- Include hreflang entries for each language version
Files to Create/Modify
website/src/components/LanguageSwitcher.astro(new)website/src/components/Navigation.astro(add LanguageSwitcher)public/sitemap.xmlor Astro sitemap config
Languages (15 total)
| Code | Native Name | Direction |
|---|---|---|
| en | English | LTR |
| es | Español | LTR |
| fr | Français | LTR |
| pt | Português | LTR |
| de | Deutsch | LTR |
| ja | 日本語 | LTR |
| ko | 한국어 | LTR |
| ru | Русский | LTR |
| uk | Українська | LTR |
| he | עברית | RTL |
| ar | العربية | RTL |
| ur | اردو | RTL |
| hi | हिन्दी | LTR |
| fil | Filipino | LTR |
| id | Bahasa Indonesia | LTR |
Deferred from i18n feature implementation. See kitty-specs/004-add-internationalization-i18n/tasks.md for full context.