HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux mail.btech-izolacje.pl 5.15.0-140-generic #150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025 x86_64
User: pewna6876 (1017)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: //usr/share/imunify360-webshield/captcha/translations/README.MD
### Captcha Localization

In order to extract text to be translated from source code run:
```
cd <IMUNIFY360_WEBSHIELD_PATH>/captcha
pybabel extract -F babel.cfg -o extracted_translations.pot .
```
This creates the PO file template extracted_translations.pot

If you don't already have translation catalogs, you need to create them.
This is done using the pybabel init command:
```
pybabel init -i extracted_translations.pot -d translations/locale/ -l ru
pybabel init -i extracted_translations.pot -d translations/locale/ -l en
```

This should create files: translations/locale/{ru,en}/LC_MESSAGES/messages.po based on extracted_translations.pot
These files are where you put the actual translations.

When you modify templates, you generally need to sync the translation catalogs.
For that, you first perform a fresh extraction as described in the previous section,
so that the extracted_translations.pot file gets updated.
Then, you run the pybabel update command to merge the changes into the translation catalogs:

```
pybabel update -i extracted_translations.pot -d translations/locale/
```

[Here is a good instruction](https://github.com/python-babel/django-babel)