All I can say is: Good Luck. There are probably enough words in different languages that are spelled exactly the same, but have vastly different meanings and pronuciation, that you'll have a noticabily high rate of error. If you're trying to get the language of an entire document (assuming the language wasn't explicitly set in a META tag or something), you might be able to take lots of words within the text and center in on a single language. Trying to get a single word is probably a lot harder.
You might be able to center in on a language based on the character set being used. Certain languages (particularly scandinavian languages) tend to have a specific character that no one else has. Asian languages also have completely different glyphs from each other.