I would like to add a dictionary funtion to my program using MySQL.
It would have 3 tables: products, languages and product_dictionary
The user would choose a product and a language and the corresponding product name would be found in the product_dictionary.
If the products table is:
products_id | product_name
1 | chocolate
2 | flour
and the languages table is:
languages_id | language_name
1 | english
2 | french
3 | german
I have two product_dictionary table ideas but I am not sure which is the best.
products_id | languages_id | translation
1 | 1 | chocolate
1 | 2 | chocolat
1 | 3 | Schokolade
2 | 1 | flour
2 | 2 | farine
Where the product_id and language_id create a compound primary key to find the translation;
or
products_id | english | french | german
1 | chocolate | chocolat | Schokolade
2 | flour | Farine | Mehl
Where the value of the language_name column from the languages table is the column name in the product_dictionary table and the product_id also being the primary key for the product_dictionary table.
Could someone give me there insight? Thank you.