score:1

Accepted answer

agree with splitting it up is a bad idea...makes translation a bigger pain than needed.

looking at your tags your using react and node.js -> for react you could take the translated content from polyglot and use dangerouslysetinnerhtml https://facebook.github.io/react/docs/dom-elements.html#dangerouslysetinnerhtml

that's what would work - but honestly i would have a look at i18next (spoiler i'm the maintainer of that framework). with the react-i18next you can do those markup translations a lot nicer: https://github.com/i18next/react-i18next/

using the trans component:

<trans i18nkey="usermessagesunread" count={count}>
  hello <strong title={t('nametitle')}>{{name}}</strong>, you have {{count}} unread message. <link to="/msgs">go to messages</link>.
</trans>

Related Query

More Query from same tag