I think that, for frequently encountered languages, the translation program of the universal translator is heavily curated with a lot of manual entry. Because many languages use a lot of idioms and metaphors which would need a manual translator to give some context at some point. So for like Klingon, Vulcan, Romulan, Cardassian, etc the software is almost entirely manually curated with only a bit of machine learning for the occasional on-the-fly stuff.
I believe the translation software is only *completely* automated/procedural when it comes across a language never encountered before. I think that, in those cases, it’s not *nearly* as good as manually curated translation. But it’s *good enough* to be somewhat intelligible in most cases (with famous exceptions like in Darmok).