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
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_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
Algorithm | Hash digest | |
---|---|---|
SHA256 | be3f353b4ffb4fef7f4a3c572827c34602517fa1d0cce316879f980f8cfd89a1 |
|
MD5 | 6c7d53924d9ba4d74adba92db0fb03f3 |
|
BLAKE2b-256 | 60daa9bc64e079c21daeeb7f30b82af116a4b1831c14d696c935c867ce40e476 |
File details
Details for the file django_perm_trans-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: django_perm_trans-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.11.3 Darwin/22.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3e27f41b837e1a0b1212129459d6bf3da0ef336c641675e14f332586b2a2be6 |
|
MD5 | 1a505a4a632e2351e9924c9bda67a5df |
|
BLAKE2b-256 | dbf6d65c259e61233a071c6fd71502abf591adf2c441ddae099b0a66a00f7cc8 |