I developed an e-shop web and I implemented unlimited language support
for all content. Every model realy holded only integer values and
values, that should't be translated. Fields like "title" and
"description" was virtual, they didn't exist in the table, but I was
able to call them like "Model.field" and get the value translated to
current language.

All the translations was stored in Trans table, with structure: (id |
table | field | fid | lang | value ). For example you have a model like
Category and every category has name and it should be in all languages.
To get the name of the category you do:

c = Category.objects.get(pk=1)
print c.name

In "print c.name" it will call __getattr__ function and then a helper
function witch will return a record from Trans table WHERE
table='category' AND field='name' AND fid=1 AND lang='EN'.

I think that this can be done in "django way", maybe later someone can
make a field like TransField and all other stuff would be automaticly.

I hope you get the point, sorry for bad english :)


--~--~---------~--~----~------------~-------~--~----~
 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to