Skip to main content

Simple language select as custom template tag

Project description

django_languageselect

PyPI PyPI

Simple language select as custom template tag

Requirements

  • "django.middleware.locale.LocaleMiddleware" in MIDDLEWARE_CLASSES / MIDDLEWARE
  • "django.core.context_processors.request" in TEMPLATE_CONTEXT_PROCESSORS / TEMPLATES['OPTIONS']['context_processors']
  • Add "django_languageselect" to INSTALLED_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


Download files

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

Source Distribution

django_languageselect-7.0.0.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_languageselect-7.0.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file django_languageselect-7.0.0.tar.gz.

File metadata

  • Download URL: django_languageselect-7.0.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for django_languageselect-7.0.0.tar.gz
Algorithm Hash digest
SHA256 b6acd26575740d32f974547a27d0daf9bec3b0c6bfee77d49d93196af76ceba2
MD5 f33d4f6c6325eb9438b76710ff4d677c
BLAKE2b-256 12c3242053f1ba4a03ee4803e53bcf421b44b1221cb4cf776f83021b2bfb356d

See more details on using hashes here.

File details

Details for the file django_languageselect-7.0.0-py3-none-any.whl.

File metadata

  • Download URL: django_languageselect-7.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for django_languageselect-7.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1f16dd5bd3db5bde88d8f1025094f35bf640486e06518964f8254fcf130079d
MD5 dc644b827f82173c8f10c1c774b696bb
BLAKE2b-256 bea1a61055b40ac678306316711812b921c5ae1a24a4418192f4ccae3b9c54dc

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