The Trados cloud platform will be undergoing maintenance on Saturday, 9th May 2026 between 05:00 to 17:00 UTC. During this time, you will not be able to log in to the Trados platform.

json with interpolation and embedded HTML

Hi there,

I am using SDL Trados Studio 2019 SR2  in order to prepare some json files.

Below you can find an example of the sort of json strings I am dealing with:

{
    "banner": {
        "message": "Try again in a few minutes. If you keep seeing this message, contact <a title="Support Team" href="{url}">Support Team</a>."
      },
    "resultsPerPage": "{typeOfResult} per page"
  }

As you can see above, there are cases of both embedded HTML (an anchor tag, including an interpolated url) and interpolation ({typeOfResult}).

I can use the embedded content HTML processor to process the embedded HTML but the interpolated variables are parsed as plain text and not protected. If I use the plaintext content processor and define the rules for capturing interpolated variables with regexp, then the embedded html is not processed (and I rather avoid using regexp for that because of translatable attributes like title or alt).

Any suggestions on how to successfully parsed this sort of json files so both the embedded HTML and the interpolated variables are protected?

Thanks!

Parents Reply
  • Thanks, Paul. Yes I did but not the right solution because translatable attributes in the embedded HTML will not be processed. I understand that you could expand the default set of regex you get with that plugin, but I personally think coming up with a super complex regex for, lets say, images with titles and alt attributes, is not a good idea. I would rather rely on the default json filetype with the html embedded processor and use the current script I have atm.

    Just to give you extra context, these are files for a Vue app using Vue i18n for localization.

    Thanks for the suggestion though.

Children
No Data