Aidas Bendoraitis wrote: > Hello Django Professionals! > > I am making a Django-based website that has to be multilingual.
Me too. :-) > Everything is clear about making the admin section and the templates > translatable. The problem is multilingual objects. > > I could think of several approaches to implement internationalization > for Django objects: > > 1. Use special tagging inside the translatable fields, i.e. > <%en%>Title<%/en%><%de%>Titel<%/de%><%lt%>Pavadinimas<%/lt%> > (this is not usable for common people, administrating the site and > tricky for implementing searches and other functionalities) I don't like this. > 2. Create class attributes for every single translatable field, i.e. > title_en = models.TextField(verbose_name=_("English Title")); > title_de = models.TextField(verbose_name=_("German Title")); > title_lt = models.TextField(verbose_name=_("Lithuanian Title")); > (it's not flexible, because you can't add languages dynamically) I'm leaning toward this. Yes, it's not flexible, but it's YAGNI for me, and the simplifying gains are huge. > 3. Create a separate DB table for every model that has translatable fields > The table would contain > - model_id > - translatable fields (title, description) > - language_id (or code) > (I find this way the most proper for implementing multilingual > objects, but.. (read further)) Complex, ugly. There's also another approach: use translation tables for content, same as it is done for the app interface. I don't like that either. -- Nicola Larosa - http://www.tekNico.net/ Continuation-based web frameworks (like Seaside) seem lame to me. I'm so much more impressed by event-based programming, and continuations (used in that way) seem like a way to avoid explicit events. Events are the web. Continuations are people who want to make the web into an MVC GUI. -- Ian Bicking, February 2006 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---