The Universal Translator
.
The universal translator is a device used to produce real-time two-way translation of spoken languages. It is operated by sensing and comparing brain-wave frequencies, then selecting comparable concepts to use as a basis for translation. Captain Kirk used a handheld universal translator (see above) to communicate with a lifeform known as the Companion in 2267.

A software version of the universal translator was programmed into the Enterprise-D's main computer. This enabled real-time communications with such lifeforms as the nanites. The communication badges worn by Starfleet personnel in the latter half of the 24th century incorporated miniature versions of the universal translator. Even smaller versions of the universal translator could be inserted into the outer ear, providing unobtrusive operation. Such devices could, however, be disrupted by exposure to beta radiation.

The universal translator generally requires an adequate sample of language in order to establish a translation matrix. This device is not infallible by any means, as noted by the unit aboard the U.S.S. Voyager which had great difficulty in translating the language of a mysterious civilization called the Swarm in 2373.
  1