Re: Database about food recipes

From: J.O. Aho <user_at_example.net>
Date: Tue, 18 Jun 2019 23:12:44 +0200
Message-ID: <gmt2ecFk5l0U1_at_mid.individual.net>


On 18/06/2019 22.49, ^Bart wrote:
> I can give you more informations and with them you'll understand why I
> think (they are just my thoughts!!!) I don't need other tables!
>
> This database will translate restaurants menu' where you can read
> recipes and ingredients but obviously you don't have units, etc.!
>

>> table languages:
>> lang_id, iso_code, name, local_name

>
> It's ok!
>
>> table ingredients:
>> ingredient_id, name, needs_translation

>
> This table will be the "master" so I'll put here just ingredients in
> english language?

[Quoted] The issue is if a Italian will add a new ingredient, you need to add a line in this table, as the system don't know the right word for it in English, it needs to put something, my suggestion is to set the Italian word, mark it as it needs to be translated to English.

>> table ingredients_translation:
>> ingredient_id, lang_id, name

>
> I connect by FK this table to table ingredients?

yes, the ingridient_id is a foreign key to the ingredients table.

>> table recipes:
>> recipe_id, name, needs_translation
>>
>> recipes_translation:
>> recipe_id, lang_id, name

>
> I think in a menu' you can leave the original version, it could be a
> good idea to have a translation but... it's quite impossibile to
> translate it by FK or maybe the restauran't owner could traslate it by
> himself but I think it's dangerous to enable him...

Sure, I guess everyone in UK would understand that it's pancakes if it says "letu" or "köttbullar och mos" as meatballs and mash.

>> recipes_ingredients:
>> recipe_id, ingredient_id, amount, unit_id

>
> I think I could link this table to the table ingredients so I could
> store here just english translation about ingredients and when the end
> user will select his language I could load a sql query to load them in
> his own language!

As you have the foreign key, you can easily get the name in what ever language, no need to duplicate data.

>> 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...

>
> I need or better... I think it's the best idea to start from english
> because everyone can "understand it" and after it every ingredients must
> be linked to this language, I know there isn't a complete translation of
> ingredients to english but I think it's more stressful and complicated
> to start with a local language (for example russian) and find the
> translation to another local language (for example italian)!
>
> I think it's better to link everything to english!

[Quoted] So you are saying you will make the ingredient list in English, if the ingredient the Russian restaurant needs ain't in the list, then they just go to another company who offers a way for him to add ingredients.

-- 

  //Aho
Received on Tue Jun 18 2019 - 23:12:44 CEST

Original text of this message