Topic: Multilingual database patterns?
Hi all.
Am I tired of having to deal with multiple languages in my Websites.
Heres is what I always end up doing:
for every element that has text that is translated I create two tables:
element_index: stuff not translated (dates, file names, booleans)
element_content: all the text + a lang field + a id to the index table.
So now everytime I wuery something I just add
->where('lang=?', $lang)
and I get the right text.
My question is simply am I missing some very easy way to do what I want to do? It does'nt seem complicated but when I get into big products tables full of dynamic categories in there own tables (so every one has a matching content table) it makes for big querys.
Sorry for my English I am a french Canadian so if anything is'nt clear just ask. For what its worth I really want a discussion on translation of stuff queryed from a db.
Thanks in advance!
edit: Ever since I started using models the translation stuff has gotten a little less heavy since I just take care of it in the constructor for my zend_db models. Used to be I had to add a lang variable everywhere ouch.
Last edited by iznogood (2010-01-11 18:20:50)