Yea, I wondered that too. No "world wide web" back when he landed on the moon. But it's plausible that they downloaded "Earth's languages" into him some point before they woke him up the same way they do it to themselves. Although, him waking up and talking his alien language forcing Optimus to speak it would have been cool. Especially if Ratchet was tinkering with his voicebox in the process, resulting in him speaking English by the end of the conversation.