Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/frol/django-db-locale

Django application to translate strings in database.
https://github.com/frol/django-db-locale

Last synced: 12 days ago
JSON representation

Django application to translate strings in database.

Awesome Lists containing this project

README

        

Django DB Locale
====================

Usage
-----

This application get the list of languages from settings.LANGUAGES and improve ability translating strings from database.
You can translate these strings in web `/db_locale/`.
After you finish translating use `Apply translation` link and than compile translations ( `./manage.py compilemessages` ).

Settings
--------

If you have the application `test_app` with the following model:

class Book(models.Model):
name = models.CharField(max_length=255)
content = models.TextField()
author = models.ForeignKey(User)

And you want translate `name`, `content` fields you can add these lines into settings.py:

DB_LOCALE_TRANSLATE_ITEMS = (
('test_app.models.Book', ('name', 'content')),
)

`LOCALE_ROOT`: (required) specify path with locales. For example, `os.path.join(settings.PROJECT_ROOT, 'locale')`

Installation
------------

1. Add "db\_locale" to your INSTALLED\_APPS
2. Migrate database
3. Bind the `db_locale` urls.py into your main urls.py with something like: `url(r'^db_locale/', include('db_locale.urls')),`
4. Configure settings
5. Import existing django.po files. ( `./manage.py import_translations_from_po` )
6. Profit