Parsing JSON to see specific Key & Value

Hi,

I am setting up a project with JSON files to be translated.

I am trying to parse it to enhance workflow.
The structure of the JSON files are as follows:

Screenshot of JSON file in Trados Studio with text highlighted in green indicating translatable content and orange highlighting for 'slug' field.

With "$..content.*" I get everything that is highlighted in green (which is what needs to be translated). The file looks like this in Trados:

Trados Studio interface showing a list of strings with checkboxes, and a question mark indicating confusion about which string is the 'slug'.

I have been asked to translate the values of "name", "seotitle", "seodescription" and "content". The "slug" (highlighted in orange) is only to be translated if there is a color in it. For example, "thisisastring" should be left as is, but if it is "thisisastring-black", "black" should be translated.

The problem is, often name, seotitle, seodescription and slug are exactly identical. This means that it will be very easy to translate the value of "slug" by mistake, thinking it's one of the value of one of the other keys. The files are also different. Some files don't have slugs, some don't have seo descriptions. So I can't predict that it's always the fourth segment or something similar.

Is there a way for me to use both "$..content.*" and another expression to show me when the segment is actually a "slug"? Optimally the slug segment would say "slug": "thisisastring" (or something similar) so I always know which ones they are.


Thank you kindly for helping!
Have a nice day.



Generated Image Alt-Text
[edited by: Trados AI at 1:58 AM (GMT 0) on 29 Feb 2024]
emoji