"Excuse me, friend. What is your name?"
Translation:Gabh mo leisgeul, a charaid. Dè an t-ainm a th' ort?
In casual writing a lot of things would be acceptable. Writing a th’ort without a space would be probably similar to writing I ’m with a space in English… nobody will kill you for that, you might even find some people who write that, but it’s not a common convention and it would be corrected in a publication.
As it goes for apostrophes and other punctuation – Duolingo is very forgiving with them, so it’s no surprise it didn’t call you on it.
This is just an orthographic convention. You may think it seems better because you are used to English (I'm) or French (l'image) but the convention in Gaelic is to leave the space in.
In some situations, where there has been a syllable reduction, they used to put apostrophes in, but now they put neither apostrophe nor space ('nam Maclennan 1925, now nam = *am mo = 'in my')
Nothing strictly wrong. But note that oirbh when spoken to a single person sounds formal or polite, and perhaps might be awkward and overly formal when paired with a charaid ‘friend’ (I have no idea how to convey that in English… ‘what is your name, sir friend/madam friend?’ perhaps?). But technically would be correct.
But note that if you use oirbh and thus are polite, you wouldn’t say gabh mo leisgeul but rather gabhaibh mo leisgeul – you wouldn’t mix-and-match polite and informal forms in a single utterance.
If Gabhaibh mo leisgeul, a charaid. Dè an t-ainm a th’ oirbh? is not accepted – I’d report it. But still, because of a charaid in there, I’d stick to informal gabh and ort.