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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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