Re: Database about food recipes

From: J.O. Aho <user_at_example.net>
Date: Sun, 16 Jun 2019 21:47:33 +0200
Message-ID: <gmnkmlFemibU1_at_mid.individual.net>


On 16/06/2019 18.51, ^Bart wrote:
> Thank you for your quick reply! :)
>

>> Link to the "mainlangtable" and skip the "alllangtable", when someone 
>> adds something in dutch and it's not in the "mainlangtable", you add 
>> the dutch word to the table, notify that the dutch word has to be 
>> translated (better to have a flag, bit, to tell if a word ain't 
>> translated to english), of course place the dutch word in the the 
>> "alllangtable".

>
> So, in mainlangtable I'll store just english ingredients, in
> alllantgtable all translations (linked to the mainlangtable) and in
> recipetable I'll have just the link to the mainlangtable right?
>
> I thought to add a user table where the user will set his own language
> so when he'll add a recipe will read ingredients in his language but the
> recipe will be "really" stored with english ingredients!

Something like this maybe:

table languages:
[Quoted] lang_id, iso_code, name, local_name

table units:
[Quoted] unit_id, name

table units_translation
unit_id, lang_id, name

table ingredients:
[Quoted] ingredient_id, name, needs_translation

[Quoted] table ingredients_translation:
ingredient_id, lang_id, name

table recipes:
recipe_id, name, needs_translation

recipes_translation:
[Quoted] recipe_id, lang_id, name

recipes_ingredients:
[Quoted] recipe_id, ingredient_id, amount, unit_id

You maybe need to think of ordering the recipe ingredients so they come in the order they are used, then you need to add a column for that in the recipes_ingredients table.

[Quoted] The needs_translation I have suggested is just a bit, to tell you that you need to find the english name for something, as it's important for you to have the id and you don't really want to leave it empty (the name) so better to have it in Dutch, or Italian till you have figured it out what it's in English. Keep in mind same recipe in different languages may have different names, not all languages will have "pancakes", some may call it letut or pankakor...

[Quoted] A bigger issue would be if pancake would be an ingredient too, then you would want to link to the recipe in the ingredient table.

-- 

  //Aho
Received on Sun Jun 16 2019 - 21:47:33 CEST

Original text of this message