Segmentation after full stop or line break on an already translated json file

Good morning,

Apart from my translations, I've been asked recently to do reviews of json files that already include their translation so that I can edit and update the content to my TM. It seems that, since the translation is already filled, Trados "blocks" it and doesn't do the normal segmentation that I would need for my translation memories. This is how it looks like:


Screenshot of Trados Studio showing a JSON file with French text. Text is not segmented after full stops or line breaks, and there are no visible errors or warnings.

I would need to have a new segment every single time there is a full stop or a line break. I've tried by adding a TM that has segmentation rules and I've checked on File>Options>Filetypes>JSON but I can't find nothing that matches what I need, so I'm afraid I'll need your help.

Thank you in advance,

Noa



Generated Image Alt-Text
[edited by: Trados AI at 9:21 AM (GMT 0) on 29 Feb 2024]
emoji
  • Good morning, Paul Smiley

    Thank you so much for your explanations step by step and the video, I highly appreciate them! I've been trying your tutorial yesterday and the day before in between other urgent translations with a couple of files and the SuperText filetype uncheck was definitely blocking me before your video. I've managed to do the alineation and to update the TM, but since it was my first time using regular expressions, I wouldn't have succeeded without your help.

    I've had a bit of a block with the "source.json" file preparation. After replacing "^\s+"target".+?\n" with nothing, there was a spare comma that didn't let me do the alineation. I've managed to solve it by replacing ",
    }," with "}," and saving afterwards. I'll leave a screenshot here just in case somebody else has a similar issue. I don't know if there is a better way to solve this with the regular expression, but this way worked for me in 2 different files and alineations.

    Screenshot of Trados Studio's 'Replace' function showing the 'Find what' field with ', ' and the 'Replace with' field with ','.


    Also, I've had another block with the third file (the one where we only want to empty the target) since I got an error. I've solved it by taking the comma out of the expression:

    ("target":\s+).+?(,\n) -> ("target":\s+).+?(\n)

    But I don't know if this would work for every case.


    Thank you so much for your assistance and your time, Paul!

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 9:22 AM (GMT 0) on 29 Feb 2024]
  •   

    I'm glad that helped.

    I've had a bit of a block with the "source.json" file preparation. After replacing "^\s+"target".+?\n" with nothing, there was a spare comma that didn't let me do the alineation. I've managed to solve it by replacing ",

    There could be a couple of reasons for this:

    1. I made up the test file, so my file could have been different to yours, especially with the non-printable spaces at the end
    2. Perhaps the syntax for the flavour of regex you are using in the tool you used is different?
    3. Also worth checking curly vs straight commas... a common problem when transferring characters between applications

    Whatever the reason I'm sure your posts will be helpful to others in the future.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji