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
Parents Reply
  • Autsch, unfortunately for the time being not. The Supertext file type is not (yet) available for S2021. In that very case you will be forced to writhe the paths on your own, unless someone here in the forum is able to give you the paths (I am not). Other solution would be having someone with Studio 2019 preparing the files for you. This is something I could imagine to be able to do. So if you wish, write an e-mail to info at tts-td dot com and give me exact information which elements need translation. I would then prepare a dummy package (with an empty TM—to be replaced by proper TM at your end) for you.

    _________________________________________________________

    When asking for help here, please be as accurate as possible. Please always remember to give the exact version of product used and all possible error messages received. The better you describe your problem, the better help you will get.

    Want to learn more about Trados Studio? Visit the Community Hub. Have a good idea to make Trados Studio better? Publish it here.

Children