Breakdown of J'allais acheter du pain avant la fermeture, par contre il y avait un embouteillage.
je
I
un
a / an (masculine)
il y a
there is / there are
acheter
to buy
Questions & Answers about J'allais acheter du pain avant la fermeture, par contre il y avait un embouteillage.
Why do we use j'allais here instead of the passé composé (je suis allé)?
Using the imperfect tense of aller (allais) followed by an infinitive (acheter) is how you express a past intention that didn't happen. It translates directly to 'I was going to buy'. If you used the passé composé (je suis allé acheter), it would mean you actually went and bought the bread.
Why is it du pain and not just le pain?
When talking about an unspecified quantity of an uncountable item like bread, you need a partitive article. Du acts like the English word 'some'. If you said le pain, it would mean you were going to buy a specific, already-mentioned loaf, or bread in a general sense.
Why do we use just avant instead of avant de before la fermeture?
What does par contre add to this sentence?
While you could simply use mais (but), par contre translates closely to 'however' or 'on the other hand'. It strongly emphasizes the contrast between your intention to buy bread and the unexpected obstacle that prevented it.