In about a decade or so, people will have memory enhancement chips installed. It'll be the preliminary to "cyborg" technology. Numerous studies have shown that human memory is quite fallible. In fact, each time you recall a memory, you inadvertently change qualities about it. This is attributed to different contexts when recalling the memory (your location, your mood, your life perspective, people you're with, etc).
But imagine if you have a memory recorded onto a chip, whereas you recall the memory (with some training) from that chip and find it to be the same details each time... because it's "read only" memory. Pretty remarkable... changes the whole ball game with human memory.
Why did I travel down this rabbit hole? Because I'll bet anything that in the Star Trek universe beyond TOS, the UT is installed in people and interfaced directly in their minds. It's the same principle as the hardware memory augment that's soon coming. So, by the same principle, not only can they hear and understand foreign languages (in the UT library), they can read foreign writings too.