django-languageselect

6.0.0last stable release 4 days ago
Complexity Score
Low
Open Issues
0
Dependent Projects
0
Weekly Downloadsglobal
1,331

License

  • MIT
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

Readme

django_languageselect

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.

Dependencies

No runtime dependency information found for this package.

CVE IssuesActive
0
Scorecards Score
3.80
Test Coverage
No Data
Follows Semver
Yes
Github Stars
7
Dependenciestotal
1
DependenciesOutdated
0
DependenciesDeprecated
0
Threat Modelling
No
Repo Audits
No

Learn how to distribute django-languageselect in your own private PyPI registry

pip install django-languageselect
Processing...
Done

11 Releases

PyPI on Cloudsmith

Getting started with PyPI on Cloudsmith is fast and easy.