Adds documentation for WAGTAILADMIN_PERMITTED_LANGUAGES.

This commit is contained in:
Bertrand Bordage 2017-04-19 15:09:58 +02:00
parent 88136dab73
commit 1a82c19191
2 changed files with 23 additions and 8 deletions

View file

@ -24,14 +24,7 @@ Change Wagtail admin language on a per user basis
Logged-in users can set their preferred language from ``/admin/account/``.
By default, Wagtail provides a list of languages that have a >= 90% translation coverage.
It is possible to override this list via the ``WAGTAILADMIN_PERMITTED_LANGUAGES`` setting.
Example:
.. code-block:: python
from django.conf import settings
WAGTAILADMIN_PERMITTED_LANGUAGES = [ ('en' , 'English'), ('pt', 'Portuguese') ]
It is possible to override this list via the :ref:`WAGTAILADMIN_PERMITTED_LANGUAGES` setting.
In case there is zero or one language permitted, the form will be hidden.

View file

@ -407,6 +407,28 @@ Date and DateTime inputs
Specifies the date and datetime format to be used in input fields in the Wagtail admin. The format is specified in `Python datetime module syntax <https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior>`_, and must be one of the recognised formats listed in the ``DATE_INPUT_FORMATS`` or ``DATETIME_INPUT_FORMATS`` setting respectively (see `DATE_INPUT_FORMATS <https://docs.djangoproject.com/en/1.10/ref/settings/#std:setting-DATE_INPUT_FORMATS>`_).
.. _WAGTAILADMIN_PERMITTED_LANGUAGES:
Admin languages
---------------
Users can choose between several languages for the admin interface
in the account settings. The list of languages is by default all the available
languages in Wagtail. To change it, set ``WAGTAILADMIN_PERMITTED_LANGUAGES``:
.. code-block:: python
WAGTAILADMIN_PERMITTED_LANGUAGES = [('en', 'English'),
('pt', 'Portuguese')]
Since the syntax is the same as Django ``LANGUAGES``, you can do this so users
can only choose between front office languages:
.. code-block:: python
LANGUAGES = WAGTAILADMIN_PERMITTED_LANGUAGES = [('en', 'English'),
('pt', 'Portuguese')]
URL Patterns
~~~~~~~~~~~~