we are developing an web application which is supposed to support multi languages the issue is when it comes to dynamic fields and how to design the database for them
let say we have these tables :
product(id(Primary),name(text),description(text))
Category(id(Primary),name(text),description(text))
when it comes to inserting data in database we should have name, description in 3 different languages so far I decided to implemented the database as follow: 1. Create a table as an intermediate table with following structure :
language_itme(id)
then create another table language with following structure like :
language(id(Primary),field_name(text),en(text),fr(text),it(text),language_item_id(INT))
the language item_id refers to id of language_item table then adding the following fields to the table product and Category,
product(id(Primary),name(text),description(text),language_item_id(INT))
Category(id(Primary),name(text),description(text),language_item_id(INT))
So for inserting a product we are going to insert these rows in database:
Auto_Generated_num -> language_item;
Then,
( Auto_Generated_num, productName,productDescription, last_id of language_item)
-> product
and then
( Auto_Generated_num, name, productName in English, productName in French,
productName in Italian, last_id of language_item) -> language
( Auto_Generated_num, description, productDescription in English,
productDescription in French, productDescription in Italian,
last_id of language_item) -> language
Does anyone here can help me with modification of this structure to make it better from design and performance point of view, or even have the experience of multi language web sites and provide me with a better solutions
thanks in advance