Add French language support to internationalization system #190
+39
−15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds comprehensive French language support to the ToughRadius web interface internationalization system, resolving the request in issue #X for adding additional translation languages.
Problem
The existing internationalization system only supported Chinese (zh_CN) and English (en_US) with a basic binary toggle switch. Users requested the ability to add French translations to make the interface accessible to French-speaking administrators.
Solution
Extended the i18n system to support French (fr_FR) as a third language option with the following key changes:
Core System Enhancement
FrFR = "fr_FR"
language constant alongside existingZhCN
andEnUS
SetTranslateLang()
to accept FrenchImproved User Interface
Replaced the binary language switch with a modern dropdown selector:
Before:
After:
Enhanced Language Switching
Updated the controller endpoint from a binary parameter to accept language codes:
/admin/translate/switch/fr_FR
- Switch to French/admin/translate/switch/zh_CN
- Switch to Chinese/admin/translate/switch/en_US
- Switch to English/switch/1
and/switch/0
)Translation Management
Usage
Administrators can now:
Backward Compatibility
All existing functionality is preserved:
Testing
This implementation provides a solid foundation for French localization while maintaining the system's existing stability and functionality.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.