Looking at the examples, it looks like something like messageformat (https://messageformat.github.io/messageformat/) would have been a good solution to them.
We've been using this at my job and we are very happy with the flexibility it provides. The hard part comes when a third party has to do the translations because someone from tech needs to be involved.