Languages have been a common part of fantasy and science fiction for a long time. They’ve seen a particular renaissance since Tolkien became popular and Gary Gygax and Co. created D&D. There are, I think, three common methods of dealing with the myriad languages that can be present in both genres. For the sake of this post, I’ll call them: Name/Describe, Occasional Word, and Scientific.
The whole issue can be easily sidestepped, of course. Thus, we see Star Trek’s universal translator and Douglas Adams’ Babel fish.
“The practical upshot of all this is that if you stick a Babel fish in your ear you can instantly understand anything in any form of language.” –Hitchhiker’s Guide to the Galaxy
The name/describe method is probably the easiest. Basically, the writer simply names the language and provides a quick description of how it sounds. This is also probably the earliest method used by fantasy and sci-fi writers. Example: “‘Greetings, traveler! Room for the night? Dinner?’ said the innkeeper, his accented Elbownian making him sound hyperactive.”
The occasional word method is a bit more complex and involves placing words from the language, almost at random, in one’s writing. R.A. Salvatore’s Drizzt Do’Urden books are a great example of this method. Example (not Salvatore): “[T]he great Vanen came to our distant and divided people many generations ago and taught us the Jala ti Falien—or the Law of Five in your language.” –Me
The scientific method is definitely the most difficult. The writer must create a fully developed language, including vocabulary, grammar, idioms, and other aspects. Those who really strive for realism here take into account vowel shifts for pronunciation, mingling of geographically related languages, and language groups. This method is, I think, relatively uncommon to rare. It is also often done retroactively (Klingon, Drow), haphazardly (George Lucas), or by linguists (Tolkien). Example: “Utta goota, Solo?” –Star Wars IV: A New Hope
Each method has its strengths and weaknesses. The first is fast and easy, but perhaps not as satisfying. The third takes a lot of research, study, and effort for every culture in the setting, but may be more enjoyable for readers. Another downside for the second and third methods is that they may require in-story translation, by more or less clunky means—see Tolkien’s Elf songs as a great example of a rather clunky translation. The second and third are also hell on spellcheck, with a lot of “Ignore All” or “Add to Dictionary” clicking. The second method is, in my opinion, a bit of a happy medium, if one that is often inconsistent.