Skip to main content

Django middleware for setting the user's language preference at request time.

Project description

Django Language Preference Middleware

This repo contains basic middleware that retrieves a user’s language preference and sets it on the request session.

Usage

Subclass LanguagePreferenceMiddleware and override the get_user_language_preference method.

Your new middleware should be tested by including LangPrefMiddlewareTestCaseMixin in your test case and overriding the middleware_class, get_user, and set_user_language_preference attributes.

Testing

$ make validate

How to Contribute

Contributions are very welcome, but for legal reasons, you must submit a signed [individual contributor’s agreement](http://code.edx.org/individual-contributor-agreement.pdf) before we can accept your contribution. See our [CONTRIBUTING](https://github.com/edx/edx-platform/blob/master/CONTRIBUTING.rst) file for more information – it also contains guidelines for how to maintain high code quality, which will make your contribution more likely to be accepted.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-lang-pref-middleware-0.3.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_lang_pref_middleware-0.3.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file django-lang-pref-middleware-0.3.1.tar.gz.

File metadata

  • Download URL: django-lang-pref-middleware-0.3.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.7

File hashes

Hashes for django-lang-pref-middleware-0.3.1.tar.gz
Algorithm Hash digest
SHA256 30c37320e6a57095cb4b45fb90302ac36b68e796295fc93ac941413ef8912502
MD5 8c9d980c20877ff9b1457ea491ee5bc6
BLAKE2b-256 8ac32e7943b7682da72dbfef3a455dc88bdcf4892edaf0b82c4253e505cd4f5f

See more details on using hashes here.

File details

Details for the file django_lang_pref_middleware-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: django_lang_pref_middleware-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.7

File hashes

Hashes for django_lang_pref_middleware-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55d01e74cb066a59e8039263237fdf8840debb49bae92efb2b46919e53f3fe26
MD5 70cd5fc1a61e5aeb05d5eb2ceae07782
BLAKE2b-256 d38869222c09086e8d8d8990658c728a5d7230fe18f7fc1c2ab0935f0f820d4c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page