What's the best way to make translations for the complex strings?

My game has alot of special textworks, like typewriter effect, rich text formatting, and other.
What’s the best way to make translations for such game - with module script, holding all strings or smth else?