Skip to content

Commit

Permalink
Update README and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rclement committed Mar 8, 2018
1 parent 738d09c commit c2dc047
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
16 changes: 8 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Or with pip_:
Usage
-----

Initialize the Flask-Language extension:
Initialize the Flask-Language extension (also compatible with the `Application Factories`_ pattern):

::

Expand Down Expand Up @@ -79,11 +79,11 @@ Before each request, Flask-Language will automatically determine the current
language in the following order:

1. The language cookie (if any and matching the allowed languages)
2. The `Accept-Language` HTTP header (if any and matching the allowed languages)
2. The ``Accept-Language`` HTTP header (if any and matching the allowed languages)
3. The provided default language

During each request context, the current language can be accessed using
`current_language`.
``current_language``.

After each request, the current language will be stored in the language cookie.

Expand All @@ -94,11 +94,11 @@ Configuration

Flask-Language is configurable via the following configuration variables:

- `LANGUAGE_COOKIE_NAME`: name for the cookie language (default: 'lang')
- `LANGUAGE_COOKIE_TIMEOUT`: validity duration (using `datetime.timedelta`) of the cookie language (default: 365 days)
- `LANGUAGE_COOKIE_DOMAIN`: domain for the cookie language (default: None)
- `LANGUAGE_COOKIE_SECURE`: set secure option for the cookie language (default: False)
- `LANGUAGE_COOKIE_HTTPONLY`: set HTTP-only for the cookie language (default: False)
- ``LANGUAGE_COOKIE_NAME``: name for the cookie language (default: ``'lang'``)
- ``LANGUAGE_COOKIE_TIMEOUT``: validity duration of the cookie language (default: ``datetime.timedelta(days=365)``)
- ``LANGUAGE_COOKIE_DOMAIN``: domain for the cookie language (default: ``None``)
- ``LANGUAGE_COOKIE_SECURE``: set secure option for the cookie language (default: ``False``)
- ``LANGUAGE_COOKIE_HTTPONLY``: set HTTP-only for the cookie language (default: ``False``)

Documentation
-------------
Expand Down
18 changes: 10 additions & 8 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Or with pip_:
Usage
-----

Initialize the Flask-Language extension:
Initialize the Flask-Language extension (also compatible with the `Application Factories`_ pattern):

::

Expand Down Expand Up @@ -82,24 +82,26 @@ Before each request, Flask-Language will automatically determine the current
language in the following order:

1. The language cookie (if any and matching the allowed languages)
2. The `Accept-Language` HTTP header (if any and matching the allowed languages)
2. The ``Accept-Language`` HTTP header (if any and matching the allowed languages)
3. The provided default language

During each request context, the current language can be accessed using
`current_language`.
``current_language``.

After each request, the current language will be stored in the language cookie.

.. _Application Factories: http://flask.pocoo.org/docs/0.12/patterns/appfactories/

Configuration
-------------

Flask-Language is configurable via the following configuration variables:

- `LANGUAGE_COOKIE_NAME`: name for the cookie language (default: 'lang')
- `LANGUAGE_COOKIE_TIMEOUT`: validity duration of the cookie language (default: 365 days)
- `LANGUAGE_COOKIE_DOMAIN`: domain for the cookie language (default: None)
- `LANGUAGE_COOKIE_SECURE`: set secure option for the cookie language (default: False)
- `LANGUAGE_COOKIE_HTTPONLY`: set HTTP-only for the cookie language (default: False)
- ``LANGUAGE_COOKIE_NAME``: name for the cookie language (default: ``'lang'``)
- ``LANGUAGE_COOKIE_TIMEOUT``: validity duration of the cookie language (default: ``datetime.timedelta(days=365)``)
- ``LANGUAGE_COOKIE_DOMAIN``: domain for the cookie language (default: ``None``)
- ``LANGUAGE_COOKIE_SECURE``: set secure option for the cookie language (default: ``False``)
- ``LANGUAGE_COOKIE_HTTPONLY``: set HTTP-only for the cookie language (default: ``False``)

API
---
Expand Down

0 comments on commit c2dc047

Please sign in to comment.