-->
Lit., "when".
As is shown in the sequence, they and their father were to suffer severe distress before their adventures came to a happy conclusion.
Lit., "it [i.e., his request that they should enter the city by different gates] had been but a desire in Jacob's heart (nafs), which he [thus] satisfied". In other words, when he gave his sons this advice, he followed only an instinctive, humanly-understandable urge, and did not really expect that any outward precaution would by itself help them: for, as he himself pointed out on parting, "judgment as to what is to happen rests with none but God". This stress on man's utter dependence on God - a fundamental tenet of Islam - explains why Jacob's advice (which in itself is not relevant to the story) has been mentioned in the above Qur'anic narrative.
This interpolated clause is based on Zamakhshari's interpretation of the above reference to Jacob's having been "endowed with knowledge".
See the last verse and n. 1730. Though they scrupulously observed their father's injunctions to the letter, their hearts were not yet pure, and they got into trouble, as the later story will show. They had the hardihood to cast aspersions on Joseph, not knowing that they were in Joseph's power. And Joseph took a noble revenge by planning a reunion of the whole family and shaming the ten brothers into repentance. He was the instrument for the fulfilment of Allah's Plan.
It is a necessity of a Prophet's soul that he should speak out and teach all that he knows, to the worthy and unworthy alike. This, Jacob did to his unworthy sons, as well as to his worthy sons whom he loved best. It was not for him as Prophet to guarantee any results. In this case he could not save his sons from getting into trouble merely because they followed the letter of his advice in a small matter. Apply this to the teaching of a greater than Jacob. Men who literally observe some small injunctions of the Holy Prophet Muhammad and neglect the greater principles which he taught cannot blame him for their troubles and difficulties. If they examined the matter, they would find that they brought the troubles on themselves.
The Prophets of Allah are full of knowledge,-not as men, but as taught by the grace of Allah. For men, as such, are (Carlyle said) mostly fools,-devoid of knowledge and understanding.