Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/frol/django-db-locale
- Owner: frol
- License: bsd-3-clause
- Created: 2011-03-08T15:25:29.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-03-08T22:33:43.000Z (over 13 years ago)
- Last Synced: 2024-10-10T20:22:32.394Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 102 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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