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
Close
Hashes for django_perm_trans-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3e27f41b837e1a0b1212129459d6bf3da0ef336c641675e14f332586b2a2be6 |
|
MD5 | 1a505a4a632e2351e9924c9bda67a5df |
|
BLAKE2b-256 | dbf6d65c259e61233a071c6fd71502abf591adf2c441ddae099b0a66a00f7cc8 |