feat(i18n): add minimal gettext-based internationalization support
📄 What does this MR do and why?
This MR introduces basic internationalization (i18n) support using gettext, without changing the current application behavior.
The goal is to prepare the codebase for future multilingual support by making user-facing strings translatable, while keeping English as the default language.
Changes made
- Added i18n initialization module (
i18n.py) - Integrated
gettextfor translation support - Marked top-level user-facing strings in
app.pyusing_() - Added Babel configuration (
babel.cfg) - Generated translation template (
messages.pot) - Added Babel dependency to:
pyproject.tomlrequirements.txt
- Updated
README.mdwith i18n setup instructions - Added test (
tests/test_i18n.py) to ensure default behavior remains unchanged
Behavior
- Application continues to run entirely in English
- No runtime language switching is introduced
- No translation files are used at this stage
- No impact on existing functionality
Verification
-
✅ Existing tests pass successfully -
✅ New i18n test confirms no regression in default behavior -
✅ Application output remains unchanged
Notes
- This MR only includes i18n infrastructure
- Localization (translation files such as
.po/.mo) is intentionally excluded - Language switching and translations will be introduced in a separate MR
Next steps
- Add localization (l10n) with language-specific translations
- Enable runtime language selection
How to set up and validate locally
-
Install dependencies
pip install -r requirements.txt -
Run the application
streamlit run app.py -
Verify that the application behaves exactly as before (English only)