# IILMP translation tree

WS5.12 / contract requirement — French, Arabic, and Portuguese activation alongside English.

This directory holds Django gettext message catalogues (`.po`/`.mo`) for the platform's UI strings. The framework is wired in `config/settings/base.py` (`LANGUAGES`, `LOCALE_PATHS`, `LocaleMiddleware`); the `.po` files start empty and are filled in over time as translators work through the strings.

## Running the gettext extraction

From the repo root, inside the web container:

```bash
docker compose exec web python manage.py makemessages -l fr -l ar -l pt
# After translators edit the .po files:
docker compose exec web python manage.py compilemessages
```

`makemessages` scans every `gettext` / `gettext_lazy` / `{% translate %}` / `{% blocktranslate %}` call across templates and Python code and writes `.po` entries to each language's `LC_MESSAGES/django.po`.

## Marking strings for translation

Python:

```python
from django.utils.translation import gettext_lazy as _

verbose_name = _("Course")
```

Templates:

```django
{% load i18n %}
<h1>{% translate "Course catalogue" %}</h1>
```

## Active languages

| Code | Language       | Notes                                     |
|------|----------------|-------------------------------------------|
| en   | English        | source language; not translated           |
| fr   | Français       | West / North / Central African francophone partners |
| ar   | العربية        | RTL layout; theme tokens already cope     |
| pt   | Português      | Lusophone partners (Mozambique, Angola)   |

The codes match the `LANGUAGES` tuple in `config/settings/base.py`. Adding a new language means three things: an entry in that tuple, a directory here with `LC_MESSAGES/`, and a fresh `makemessages` run.
