New Zenner
- Join Date:
- Oct 2010
- Location:
- Glasgow, Scotland
- Posts:
- 29
- Plugin Contributions:
- 0
Database storage logic: mutli-language quesstion.
Hi,
I am modifying an addon and have a question regarding the rules to apply for storing data in the products_options table. (This question may apply to other tables too).
I am adding new Product Options. For this I have to insert values for the three most important fields:
products_options_id
language_id
products_options_name
The first two comprise a combined primary key.
My question is: if I have the option "Size" (English), and I want to add the Spanish equivalent "Tamaño", should both entries share the same
products_options_id and just different language_id? ie:
products_options_id = 1
language_id = 1
products_options_name = Size
products_options_id = 1
language_id = 2
products_options_name = Tamaño
Alternatively, Should both entries have both primary fields different? ie:
products_options_id = 1
language_id = 1
products_options_name = Size
products_options_id = 2
language_id = 2
products_options_name = Tamaño
Both options would produce two unique combined primary keys.
I need to know this to ensure that when switching language in my shop, the system continues to display the correct options, just in the different language.
I would expect that the first scenario is the correct one, but I cannot find any documentation anywhere to confirm this (is it available anywhere?).
Thanks.