I would like to include some JSON strings for translation but not all. How do I do this?

Hi, I have received a JSON file to translate and I would only like to translate the default message text. To do this, would I click on Parser>Specify rules for extracting? If so, is anyone able to suggest a rule so that only the default message is translated and not the description? Thanks in advance!

Screenshot of a JSON file with two fields: 'defaultMessage' containing the text 'Your password has' and 'description' containing the text 'Password does not co'.



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

    To do this, would I click on Parser>Specify rules for extracting?

    Correct, otherwise you get them all.  Unfortunately the out of the box filetype isn't very friendly and doesn't extract the rules so you can decide which ones you want... which would be much more user friendly.  So you need to define the rules yourself.  A good site to start with would be this one:

    https://goessner.net/articles/JsonPath/

    Simple rule:

    $..defaultMessage

    Added here:

    Trados Studio options window showing JSON Parser settings with 'Specify rules for extracting' selected and a specified JSON path for extracting '$..defaultMessage'.

    But this is based on me creating a test file from the very little I can actually see:

    {
    	"account.password.error.policy": {
    		"defaultMessage": "Your password isn't compliant...",
    		"description": "Password needs 1 capital letter, 2 turtle doves and a ...."
    	}
    }

    It always helps to provide a test file when you need help like this.  It's much easier for you to take a snippet of the actual code and then obfuscate the text if it's confidential.  All we need is the structure.

    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



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