Skip to content

feat(i18n): added minimal gettext-based internationalization support

Sahasra Reddy requested to merge feature/i18n into feature-final

📄 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 gettext for translation support
  • Marked top-level user-facing strings in app.py using _()
  • Added Babel configuration (babel.cfg)
  • Generated translation template (messages.pot)
  • Added Babel dependency to:
    • pyproject.toml
    • requirements.txt
  • Updated README.md with 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

  1. Install dependencies
    pip install -r requirements.txt

  2. Run the application
    streamlit run app.py

  3. Verify that the application behaves exactly as before (English only)


Merge request reports

Loading