In *Hitch-Hiker's Guide to the Galaxy* I know you put the Babel Fish in your ear and it telepathically translates any language, and the one from *Star Trek* could translate languages that the Federation had encountered but had limitations.
Basically, what would it take to make a non-organic device that can translate any foreign language it encountered? What would it need to be able to do? Like if an alien from another galaxy arrived in Milky Way space?