Skip to main content

A simple way to translate the permissions of your Django project.

Reason this release was yanked:

This version has an error in the logic to remove the app name and model name from the permission

Project description

Django permissions translation

A simple way to translate the permissions of your Django project.

Overview

This package helps you translate the permissions of your Django project.
It's very useful when you have a project with multiple languages or when you use the Django Admin for end users.

Requirements

  • Python 3.8+
  • Django 4.2 (tested)

Installation

pip install django-perm-trans

settings.py

INSTALLED_APPS = [
    ...
    'django_perm_trans',
    ...
]
Configuration
DJANGO_PERM_TRANS = {
    'separator': '->', # Default: '|' - Separator between words (change | to ->)
    # 'capitalize_words': True, # Default: False
    # 'remove_app': True, # Default: False
    # 'remove_model': True, # Default: False
    
    # Custom function to translate the permission and format
    # ATTENTION: This function overrides the other options
    # 'custom_function': lambda perm: perm.name, # Default: None
}

Roadmap

  • Apply of capitalize in the words.
  • Separator configurable.
  • Remove app name from the permission.
  • Remove model name from the permission.
  • Custom function to translate the permission.
  • Unit tests.
  • Compatibility tests (Django versions).
  • Use translation from database (configurable in admin).
  • Command to translate the permissions from API.
  • Documentation.

License

MIT

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_perm_trans-0.1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

django_perm_trans-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file django_perm_trans-0.1.0.tar.gz.

File metadata

  • Download URL: django_perm_trans-0.1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.11.3 Darwin/22.4.0

File hashes

Hashes for django_perm_trans-0.1.0.tar.gz
Algorithm Hash digest
SHA256 be3f353b4ffb4fef7f4a3c572827c34602517fa1d0cce316879f980f8cfd89a1
MD5 6c7d53924d9ba4d74adba92db0fb03f3
BLAKE2b-256 60daa9bc64e079c21daeeb7f30b82af116a4b1831c14d696c935c867ce40e476

See more details on using hashes here.

File details

Details for the file django_perm_trans-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_perm_trans-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3e27f41b837e1a0b1212129459d6bf3da0ef336c641675e14f332586b2a2be6
MD5 1a505a4a632e2351e9924c9bda67a5df
BLAKE2b-256 dbf6d65c259e61233a071c6fd71502abf591adf2c441ddae099b0a66a00f7cc8

See more details on using hashes here.

Supported by

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