<commit_before>.. _page-localization:

Localization
------------

Translations are hosted at `TranslateWiki
<https://translatewiki.net/wiki/Translating:Dissemin>`_, for an easy-to-use
interface for translations and statistics.

We use `Django's standard localization system <https://docs.djangoproject.com/en/1.8/topics/i18n/>`_, based on i18n.
To generate the PO file, let's say for french, run::

    python manage.py makemessages -l fr

Once you haved filled the translations in ``locale/fr/LC_MESSAGES/django.po``,
compile them so that they can be displayed on the website::

    python manage.py compilemessages

That's it! The translations should show up in your browser if it indicates
the target language as your preferred one.

<commit_msg>Added a section how to change the available languages<commit_after>.. _page-localization:

Localization
------------

Translations are hosted at `TranslateWiki
<https://translatewiki.net/wiki/Translating:Dissemin>`_, for an easy-to-use
interface for translations and statistics.

We use `Django's standard localization system <https://docs.djangoproject.com/en/1.11/topics/i18n/>`_, based on i18n.
To generate the PO file, let's say for french, run::

    python manage.py makemessages -l fr

Once you haved filled the translations in ``locale/fr/LC_MESSAGES/django.po``,
compile them so that they can be displayed on the website::

    python manage.py compilemessages

That's it! The translations should show up in your browser if it indicates
the target language as your preferred one.

Available Languages
-------------------

You can change the set of available languages for your installation in ``dissemin/settings/common.py`` by changing the ``LANGUAGES`` list, e.g. by commenting or uncommenting the corresponding lines.
{'fraction_non_alphanumeric': 0.10236220472440945, 'fraction_numerical': 0.007311586051743532, 'mean_word_length': 4.097421203438396, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7630005', 'n_tokens_mistral': 526, 'n_tokens_neox': 487, 'n_words': 204}