A Django app with utilites to assist in project-wide translation
Project description
django-db-translate is an app with utilites to assist in project-wide translation.
With django-db-translate, you can:
Select fields from the database to include in .po files using makemessages
Edit translations directly in the admin site
- Note
This app is a work in progress and may break unexpectedly.
Quick start (Database Translations)
Add “django_db_translate” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ..., "django_db_translate", ]Add your project’s locale directory to your LOCALE_PATHS setting like this:
LOCALE_PATHS = [ BASE_DIR / 'locale' ]Run python manage.py migrate to create the models.
Add a translatable_fields class attribute to any model with fields you want to be translatable:
class MyModel(models.Model): translatable_fields = ('txt_field',) txt_field = models.CharField()Run python manage.py makemessages --all --include-db-strings to generate the .po files
Quick start (Admin Translation Editing)
Follow steps 1-3 from Quick start (Database Translations)
Include the custom admin site inplace of the standard admin site in your project’s URLconf:
from django_db_translate import admin urlpatterns = [ ..., # Your other URLs here path("admin/", admin.site.urls), ]Give the Dbtranslate | db translate permissions | Manage translations permission to any user that requires translation editing permissions
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_db_translate-0.2.1.tar.gz.
File metadata
- Download URL: django_db_translate-0.2.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec8d66f967f75a83a20dbeb5521b80e9a0b8d8292448d34056fd11cf83209e3d
|
|
| MD5 |
63ac529adb14c3016a8896bc289874ea
|
|
| BLAKE2b-256 |
c569a3d161130b1ff69aebb4d546760e635a5320fca60d3c6d959b960ced91c6
|
File details
Details for the file django_db_translate-0.2.1-py3-none-any.whl.
File metadata
- Download URL: django_db_translate-0.2.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c322bdd05385e687b442a177ecd4ba431896bd44d3f9b2936af2db23394bf7c
|
|
| MD5 |
e756852720e0e274d87ffe27127c9573
|
|
| BLAKE2b-256 |
186b2c2e13245137ffe96a2bf4f8fa9e72d7f1470eec98d246337c722d8b55df
|