I want to run an article site on several languages, I already translated translation strings, so my templates are ready. I only have a questions how to store articles in many languages? Should I create a database for each translation or it works in different way?
If I have for example this basic model:
class Article(models.Model):
models.TextField()
And want to store data in many languages, how do I do it? How to organize redirects between one article on different languages
A multi-lingual website is a website where the content is written in more than one language. The information displayed in different languages is often the same, but maybe tailored for different audiences. Booking.com is an example of a multi-lingual website as its content is available in 35 different languages.
Django Simple Multilingual Support for models An inefficient, minimal and utterly simple approach to model translation based on foreign key relations and attribute proxying. The project code is forked from the original project by yazzgoth on Google code.
Weglot is a complete multilingual solution that lets you automatically translate your entire website into over 100 languages. It uses a combination of Google, Microsoft, and DeepL translation services depending on the language pair – to deliver the most accurate results.
One simple approach to this problem is to add a "language" field in each model which identifies the language used for each record. This seems to be the approach used by django-pluggable-model-i18n.
Another approach is to use Python metaclasses to identify fields for translation, as used by django-translate and django-transmeta.
There are several other projects but many of them seem abandoned or lower quality. Django-transmeta always seemed the most interesting to me.
Edit: muhuk just wrote an excellent article today reviewing different translation projects: http://www.muhuk.com/2010/01/dynamic-translation-apps-for-django/
There is also: django-multilingual
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With