feat(mobile): Add internationalization (i18n) support#1957
feat(mobile): Add internationalization (i18n) support#1957bvisible wants to merge 12 commits intoThe-Commit-Company:developfrom
Conversation
- Add i18next and react-i18next for translation management - Create English (en.json) and French (fr.json) locale files - Replace all hardcoded user-facing strings with translation keys - Add language selector in profile settings - Configure i18n with language detection and persistence
- Create dedicated language selection page - Update LanguageSetting to navigate to the new page - Show current language with chevron indicator
- Add ai_thread_created event handler in useChatStream for auto-navigation - Update is_thread flag on parent message when AI thread is created - Fix ViewThreadButton to properly revalidate reply count on mount/focus - Remove duplicate reply count display in thread button
|
@bvisible The translation strings here make it much more harder to manage. We would add translations similar to how Frappe offers them on the web. That would also remove duplicate translation files (one for mobile, the other for web). Example: |
|
@barredterra Thoughts? |
|
Having JSON in addition to .po files seems wasteful/duplicative. Can't i18next handle .po files? |
- Replace t('key.subkey') pattern with __("English text") Frappe style
- Use raven/locale/fr.po as single source of truth for translations
- Add po-to-json.js script to convert .po to JSON at build time
- Add sync-po-with-code.js to extract strings from components
- Force app re-render on language change via Providers.tsx
- Add react-native-worklets dependency (required by NativeWind)
This addresses the concerns raised in PR review:
- No more duplicate translation files (web + mobile share .po)
- Frappe-compatible format using __() function
- 335 French translations preserved from original PR
Refactored i18n to Frappe-style with single .po sourceBased on the feedback, I've refactored the i18n implementation to: Changes Made
ArchitectureStats
This should address the concerns about:
|
Summary
Changes
This PR introduces full internationalization support for the Raven mobile app, allowing users to use the app in their preferred language. All user-facing text (buttons, labels, messages, error texts, menu items, etc.) has been wrapped with the translation function and corresponding translation keys have been added to the locale files.
Test plan