I need to store products for an e-commerce solution in a database. Each product must have descriptive information such as name, description, etc.
I need a product to be localized by x number of languages.
What I have done so far is to make any column that needs to be localized, and nvarchar(MAX)then I store the XML string as follows:
<cultures>
<culture code="en-us">Super fast laptop</culture>
<culture code="da-dk">Super hurtig bรฆrbar</culture>
</cultures>
And when I load it from the database into my business logic objects, I parse the XML string in Dictionary<string, string>, where the key is the culture / language code.
So when I want to display the product name, I do this:
lblName.Text = product.Name["en-us"];
Does anyone have a better solution?
source
share