Last post Mar 28, 2008 08:47 AM by famous
Mar 28, 2008 04:16 AM|SuperJB|LINK
I'm gonna be building a multilanguage website. I understand how to use Local and Global Resources to manage the text in my Web Forms, no problem here... my question has more to do with the database:
I'm gonna have info of (lets say) companies and their description. Obviously this info must be supported in every language that the website supports. What's the best way to go about storing multilanguage data? Should i create the same table for each language
OR should i have this info all in 1 table and add as many fields as there are languages?
I know it seems confusing :p
Thanks in advance,
Mar 28, 2008 08:47 AM|famous|LINK
One option is to store data in a different database for each language assuming each database has the same structure. Though I do not like it, some use it as a workaround.
The best way, in my opinion is to split information in two tables. e.g in your case you want to store company information, assume that in table COMPANIES you store common information for all languages like phone, email, publishedDate e.t.c. At a second table
named COMPANIES_LANG you store text and varchar values having the description for each language. Join these two tables using the CompanyId of the COMPANIES table. In table COMPANIES_LANG consider having a field named languageCode where you should store the
language code like 'en', es' or 'en-US' etc. so as to easily query the row for the corresponding language.
Hope I was helpful.