Simple language select as custom template tag
Project description
django_languageselect
Simple language select as custom template tag
Requirements
"django.middleware.locale.LocaleMiddleware"
inMIDDLEWARE_CLASSES
/MIDDLEWARE
"django.core.context_processors.request"
inTEMPLATE_CONTEXT_PROCESSORS
/TEMPLATES['OPTIONS']['context_processors']
- Add
"django_languageselect"
toINSTALLED_APPS
Usage
To use django_languageselect in a project, add it to INSTALLED_APP
INSTALLED_APP = [
*INSTALLED_APP,
'django_languageselect',
]
Add this to your urls.py
urlpatterns = [
*urlpatterns,
url(r'^languageselect/', include('django_languageselect.urls')),
]
Use the languageselect tag where you which to show languages list:
{% load languageselect %}
{% languageselect %}
Routes
The only url provided by this application is "languageselect_index". Required GET-parameter is "language", optional GET-parameter is "next". Next contains the named url to redirect after the language change. This parameter is pre-filled with the current page url. Customization
Feel free to use your own template, just add languageselect/layer.html
- Free software: MIT license
Tests
Tests will be automatically run by travis on commit to master.
They can also be executed locally using docker-compose by running docker-compose up
Making a new release
This project makes use of RegioHelden's reusable GitHub workflows.
Make a new release by manually triggering the Open release PR
workflow.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django_languageselect-6.0.0.tar.gz
.
File metadata
- Download URL: django_languageselect-6.0.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
e77180747788d4cce6577a9b592c848d764dde1d0289bd378340ae03bfe0d656
|
|
MD5 |
c11bf5c42f55c10fe9f27234c6942105
|
|
BLAKE2b-256 |
5a9ade46f361e442585eec829ee419034000348e0c535e394860d66ab2646305
|
File details
Details for the file django_languageselect-6.0.0-py3-none-any.whl
.
File metadata
- Download URL: django_languageselect-6.0.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
d6e764cc815db235b3fb6c82caa0533b0f402e386dc551fca6a94c3ed604b6c6
|
|
MD5 |
6f687202918e0894eb6352962b353313
|
|
BLAKE2b-256 |
57051979764100371043b6daacac87ee8fcf84e7f7c787cb4c84e113fe29e0e3
|