"Oil and a white onion are needed."
Translation:Il faut de l'huile et un oignon blanc.
a) "On a besoin d'huile et d'un oignon."
"D'huile" is correct whereas "de l'huile" is not because "de" is being used as a preposition in this instance. When "de" is used as a preposition preceding an indefinite noun, the article (le, la or l') doesn't appear with the noun.
Note that in "de l'huile," since "de" is to be interpreted as a preposition (rather than as part of the indefinite article "de l'"), "on a besoin de l'huile" would translate as "we need the oil." But that's not what we're trying to say; we simply want to say "we need oil," because we're not referring to any specific oil. To achieve this, we say "d'huile" and not "de l'huile."
Note also that "de" appears before "un oignon" in the sentence "on a besoin d'huile et d'un oignon," because it's being used as a preposition—and being repeated before each noun in a bid for meticulous grammar.
b) "Il faut de l'huile et un oignon."
As opposed to the example above with "on a besoin," the word "de" in "il faut de l'huile" is not used as a preposition. In this case, it's part of the indefinite article "de l'" connected with "huile," as in "de l'huile" (some oil). Hence why the word "de" does not and should not appear before "un oignon"; "un" is the indefinite article for "oignon" and that's all we need here. Note how "un" mirrors the use of "de l'" as an indefinite article.
Thank you Lyn. I am still confused:
a). It has always been told that French always requires "le" before nouns while English does not. "d'huile" means no le. That is the point confusing me.
b). "Il faut de l'huile et un oignon." -- should we have another "de" before "un oignon blanc"?
Just because the words were exactly matched with the interpretation, it does not mean they are in the right order. I have done this a lot and am still finding it hard to learn where to put the French words as opposed to where they would be in English, as you must be too (assuming that English is your native language). Or, if you feel confident that you got it correct and Duolingo refused the translation, then report it. Also, *interpretation.
Duolingo doesn't like "Il faut un oignon blanc et de l'huile". I had previously translated this sentence as "Il faut un oignon blanc et l'huile", again, a version Duolingo did not like. I had also tried "Il faut un oignon blanc et d'huile", again unsuccesfully. Why can I not have the onion before the oil as in the English wording?