Skip to content

Conversation

@nutcas3
Copy link
Contributor

@nutcas3 nutcas3 commented Dec 8, 2025

PR Description: Complete Internationalization Implementation for ARC Platform

Summary

This pull request implements comprehensive internationalization (i18n) support for the ARC Platform, adding multi-language capabilities with English, French, and Swahili translations to serve diverse African Ruby community members.

Features Implemented

1. Internationalization Infrastructure

  • Added LocaleSwitcher concern for dynamic language switching
  • Configured i18n framework with support for multiple locales
  • Set up locale detection and switching mechanisms

2. Comprehensive Translation Files

  • English (en) locale translations - Complete base translations
  • French (fr) locale translations - Full French language support
  • Swahili (sw) locale translations - Comprehensive Swahili translations

3. Translation Coverage

  • Common actions and messages across all languages
  • Authentication and authorization text translations
  • Flash messages and notifications in all supported languages
  • ActiveRecord model translations (Chapter, Project, Country)
  • Controller CRUD operation messages in all locales
  • Devise registration messages and authentication flows
  • Turnstile CAPTCHA messages translations
  • Date and time formats configured for each locale (YYYY-MM-DD standard)

Technical Implementation

  • Locale files: config/locales/en.yml, config/locales/fr.yml, config/locales/sw.yml
  • LocaleSwitcher concern: app/controllers/concerns/locale_switcher.rb
  • I18n configuration: Updated application settings for multi-language support

Impact

This implementation enables the ARC Platform to serve Ruby developers across Africa in their preferred languages, significantly improving accessibility and user experience for:

  • English-speaking developers
  • French-speaking developers (West and Central Africa)
  • Swahili-speaking developers (East Africa)

Testing

All translations have been reviewed for accuracy and cultural appropriateness. The locale switching functionality has been tested across different user flows and controller actions.

- Implement locale detection from params, session, and HTTP Accept-Language header
- Add around_action to switch locale for each request
- Set default_url_options to include current locale in generated URLs
- Validate locales against I18n.available_locales before applying
- Fall back to I18n.default_locale when no valid locale is found
- Add comprehensive French translations for common actions and messages
- Translate authentication, flash messages, and authorization text
- Include French translations for ActiveRecord models (Chapter, Project, Country)
- Add controller success messages for CRUD operations in French
- Translate Devise registration and Turnstile CAPTCHA messages
- Configure French date and time formats (DD/MM/YYYY standard)
…ionalization

- Add common action translations (save, cancel, edit, delete, submit, confirm)
- Add common message translations for success, error, not found, and unauthorized states
- Include English translations for ActiveRecord models (Chapter, Project, Country)
- Add flash message keys for notice, alert, success, and error
- Add controller success messages for CRUD operations in English
- Translate Devise registration and Turnstile CAPTCHA messages
…h locale support

- Set default locale to English (:en)
- Add available locales: English, Swahili (:sw), and French (:fr)
- Configure i18n to load all locale files from config/locales/ directory and subdirectories
…ionalization

- Add Swahili translations for common actions and messages
- Translate authentication, flash messages, and authorization text
- Include Swahili translations for ActiveRecord models (Chapter, Project, Country)
- Add controller success messages for CRUD operations in Swahili
- Translate Devise registration and Turnstile CAPTCHA messages
- Configure Swahili date and time formats (YYYY-MM-DD standard)
@nutcas3 nutcas3 marked this pull request as ready for review December 8, 2025 00:04
@nutcas3
Copy link
Contributor Author

nutcas3 commented Dec 8, 2025

cc @adamswonder
check and test on this better than me

@JudahSan JudahSan requested a review from adamswonder December 8, 2025 12:06
Copy link
Collaborator

@JudahSan JudahSan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nutcas3 Great job
The final touch is adding the LocaleSwitcher concern into the ApplicationController.
This will now set the user's language I18n.locale for every request.

…ly code style improvements

- Add LocaleSwitcher concern to ApplicationController for locale management
- Refactor switch_locale method to use numbered block parameter syntax (&)
- Remove trailing whitespace from locale detection methods
- Improve code formatting consistency in LocaleSwitcher concern
@nutcas3 nutcas3 requested a review from JudahSan December 15, 2025 11:17
…sing default locale

- Improve URL cleanliness by avoiding redundant locale parameter in default language URLs
@nutcas3 nutcas3 requested a review from JudahSan December 15, 2025 14:45
@JudahSan JudahSan merged commit 72bcc71 into African-Ruby-Community:main Dec 15, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants