Translation of a Django model: store translations in a database or use gettext?

I am in the process of I18N django site.

I selected two potentially useful django applications:

From your point of view, what are the pros and cons of these two methods?

+6
django django-models internationalization gettext translation
source share
3 answers

If you want users of your application (or third-party translators) to easily update translations without changing the code, go to one of the solutions that stores translations in the database.

If you need better control (version control, multiple sets of eyes, etc.), use gettext. Using gettext, you can also control which lines you want to translate.

Just my 2c.

+6
source share

django-modeltranslation is best to store the translated value. you go to django-admin and put the translated value.

But if you use django-dbgettext , you do not need to specify any value in django-admin, you can use rosetta for this. If you cannot find any value for the translation and want to translate it, then you can record the model in " * dbgettext_registration.py * " and run the command "python manage.py dbgettext_export", then "python manage.py compilemessages".

+4
source share

http://packages.python.org/django-easymode/ combines the two:

http://packages.python.org/django-easymode/i18n/index.html

http://packages.python.org/django-easymode/i18n/translation.html

Gettext is used to translate large amounts of data, and the administrator is used for daily updates.

0
source share

All Articles