I'm currently designing a e-commerce solution. One of the primary requirements is for the store to support localized item details. The same store must be able to support multiple languages via the user's language selection and/or browser preference.
I have two tables:
Item (id, sku, price, ...)
ItemDetails (item_id, language, title, ...)
For each Item, there will be multiple rows corresponding to the item, where the (item_id,language) pair will be unique.
I would like to model this as:
class Item
{
public string sku;
public double price;
public ItemDetails Details;
}
Based on the user's session, I would like the items returned to have the Details object corresponds to the user's selected language (from their session).
What are some approaches for representing this?