Mini Shell

Direktori : /usr/share/imunify360-webshield/captcha/translations/
Upload File :
Current 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)

Zerion Mini Shell 1.0