"The window opens onto the yard."
Translation:La finestra apre sul cortile.
That would be literally 'on top of the yard', which is an indication of place that is incorrect here. The use of 'sul' is idiomatic here, I assume.
Giardino means garden. Cortile means yard, which I guess could contain a garden, but is generally a larger space not necessarily for growing flowers.
I suggest the translation "la finestra dà sul cortile". It's used in elegant italian.