Skip to content

Babel

ashritha kunjeti requested to merge Bable into feature-final

What does this MR do and why?

This MR implements the foundational infrastructure for Internationalization (i18n) in the GitLab Compliance Checker project using Python Babel.

Key highlights:

Infrastructure: Added

gitlab_utils/i18n.py to manage gettext initialization and language loading. Workflow: Created

babel.cfg to enable automated message extraction from the codebase while ignoring virtual environments. Reference Implementation: Updated

app.py to use the i18n utility and marked the main application title for translation using the

_() marker. CI/CD Integration: Updated

.gitlab-ci.yml to include a validation step that ensures message extraction remains functional during the pipeline. Dependencies: Added Babel to developer dependencies in

pyproject.toml . This ensures the project is architecturally ready to support multiple languages (e.g., Telugu, Hindi) without further structural changes.

References

Internal task: Minimal Babel/i18n Setup

How to set up and validate locally

Install new dependencies:

bash uv sync --all-extras Verify message extraction: Run the following command to ensure Babel correctly identifies the strings:

bash uv run pybabel extract -F babel.cfg -o base.pot gitlab_utils/ modes/ batch_mode/ user_profile/ issues/ app.py Inspect the template: Open

base.pot to verify that "GitLab Compliance & Analytics Tool" is listed under msgid.

Verify CI compatibility: Ensure the lint checks pass locally:

bash uv run ruff check . uv run ruff format --check .

MR acceptance checklist

[x] Initial infrastructure for i18n is implemented. [x] Code follows basic Python internationalization best practices. [x] Pipeline integration for i18n extraction is added to gitlab-ci.yml [x] Documentation for validation is provided above.

Merge request reports

Loading