Xenoglossy is the putative paranormal phenomenon in which a person is able to speak or write a language he or she could not have acquired by natural means. For example, a person who speaks Swedish fluently, but who is not a native Swedish speaker, has never studied Swedish, never been to a Swedish-speaking country, and never associated with Swedish speakers or had any other source of exposure to the Swedish language, would be said to exhibit xenoglossy. (Wikipedia)
This is an interesting phenomenon that seems to happen when a person has had serious head trauma, surgery, or migraines.
I have also heard of people speaking another language when they are temporarily possessed by a spirit. This happened to a friend of mine in the middle of the night. She started speaking an unknown language with a male-sounding voice in her sleep which freaked her husband out.
It can make your head spin for hours thinking about it. No pun intended. Below are links to some articles where people have suddenly developed foreign accents or spoken foreign languages:
British woman suddenly has a Chinese accent:
Malaysian girl suddenly speaks four languages:
American woman wakes up with a British accent after surgery: