Skip to content
This repository was archived by the owner on Nov 14, 2024. It is now read-only.

openedx-unsupported/django-lang-pref-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a204271 · Nov 14, 2024
Sep 10, 2024
Sep 10, 2024
Oct 29, 2024
Aug 27, 2014
Mar 25, 2020
Aug 28, 2014
Jan 12, 2015
Nov 10, 2021
Jun 1, 2022
Jan 12, 2015
Nov 14, 2024
Jun 18, 2020
Aug 21, 2020
Sep 10, 2024
Jul 9, 2020
Jul 9, 2020
Sep 10, 2024
Sep 10, 2024

Repository files navigation

⚠️ DEPRECATION WARNING

This repository is deprecated. It will no longer receive maintenance, support, or updates from the Open edX project.

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 before we can accept your contribution. See our CONTRIBUTING 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.