Translating json with only specific elements

Dear team,

I have a couple of following JSON files and I want to extract only the text from following elements: heading, description, button_text, title, editor, text, _title

https://we.tl/t-SP20FHEU5W

I tried by copying the Path from Notepad+, but it copied only the direcet path to the very element and the next one is not extracted. E.g.:

.content[0].elements[0].elements[1].settings.slides[0].heading

I tried to remove the numbers in brakets and it showd nothing at all:
.content.elements.elements.settings.slides.heading

Please, help me write the path so that it exports the text from the elements:  heading, description, button_text, title, editor, text, _title

Maybe it is better if the exact level of the path is not specified?

My Trados verion: Trados Studio 2022 SR2 - 17.2.9.18688

Sotir

emoji
Parents
  • Hello Sotir,

    To extract only specific elements from your JSON files in Trados Studio 2022 SR2, you can follow these steps:

    Step 1: Open your project settings in Trados Studio.

    Step 2: Navigate to 'File Types'.

    Step 3: Find and select 'JSON' from the list.

    Step 4: In the 'JSON' settings, go to 'Parser' -> 'String value extraction'.

    Step 5: Change the setting to 'Specify rules for extracting'.

    Step 6: Add a JSON path for each element you want to extract. For example, for the 'heading' element, you would add a JSON path as `[*].heading`. Repeat this step for 'description', 'button_text', 'title', 'editor', 'text', and '_title'.

    Step 7: Make sure the box next to 'Translatable' is ticked for each path you add.

    Please note that 'Document Structure Information' and 'Name of sibling defining SID' are not relevant for your case, so you can leave them at their default settings.

    If you're still having trouble finding the correct JSON paths, I recommend using a JSONPath Finder and Evaluator tool. These tools can help you find the correct paths in your JSON files.

    I hope this helps! If you have any other questions, feel free to ask.

    Best regards,

    RWS Community AI

    emoji
Reply
  • Hello Sotir,

    To extract only specific elements from your JSON files in Trados Studio 2022 SR2, you can follow these steps:

    Step 1: Open your project settings in Trados Studio.

    Step 2: Navigate to 'File Types'.

    Step 3: Find and select 'JSON' from the list.

    Step 4: In the 'JSON' settings, go to 'Parser' -> 'String value extraction'.

    Step 5: Change the setting to 'Specify rules for extracting'.

    Step 6: Add a JSON path for each element you want to extract. For example, for the 'heading' element, you would add a JSON path as `[*].heading`. Repeat this step for 'description', 'button_text', 'title', 'editor', 'text', and '_title'.

    Step 7: Make sure the box next to 'Translatable' is ticked for each path you add.

    Please note that 'Document Structure Information' and 'Name of sibling defining SID' are not relevant for your case, so you can leave them at their default settings.

    If you're still having trouble finding the correct JSON paths, I recommend using a JSONPath Finder and Evaluator tool. These tools can help you find the correct paths in your JSON files.

    I hope this helps! If you have any other questions, feel free to ask.

    Best regards,

    RWS Community AI

    emoji
Children
No Data