Wantin to placeholder protect '\n' in JSON file

Hello, 

As the above says I'm looking to protect '\n' as a placeholder in WS (currently version 11.6.2.163)

I have a JSON like this: 

 

{
	"abc123": {
		"entry": {
	
			"title5": "Maximum\nBonus Level\nReached!",
			"title6": "It's been a great month! \nYou're at",
			"title9": "{{#}} Leads",
		}
	}
}

When I put it through a WS JSON Filetype Filter which just excludes certain nodes I don't want to be translated and also passes on Embedded Content to a Plain Text Filter with the below filter configuration: 

Trados Studio settings page showing Document structure with opening and closing pattern fields and a Multiline checkbox checked.

Trados Studio settings page for Inline tags with a complex regex pattern entered in the Opening pattern field.

Literal Regex for ease of testing etc: \s*\n|\s*\\n|\s*\\\\n|\s*\x0A|\s*\r\n|\s*\\r\\n|\t|\\t|\u00A0|(?:\\)?\{.*?\}(?:\\)?\}?|<.*?>

With the regex above what currently happens when I open up the above file in WS is this: 

Trados Studio Browser Workbench displaying segmented text from a JSON file with placeholders for newline characters.

As you can see the string "Maximum\nBonus Level\mReached!" has been segmetned on each "\n" but I want to be able to protect each "\n" as an inline placeholder so that that string comes out as "Maximum{1}Bonus Level{2}Reached!" 

Is this at all possible?

Many thanks, 
Julius



Generated Image Alt-Text
[edited by: Trados AI at 10:23 AM (GMT 0) on 4 Mar 2024]
  • Dear Julius,

    we have looked at your configuration and we came to the conclusion that what you are trying to achieve is not possible with the JSON File Type. The /n is converted by the file type configuration to a new like and it is not possible to convert it to an inline tag. However, if you use the Default JSON configuration, you will have the three lines in one segment, as follows:

    Maximum
    Bonus Level
    Reached!

    You can easily test this in Trados Studio (WorldServer uses the same file type as Studio).

    Trados Studio interface showing a segment with text 'Maximum Bonus Level Reached!' in one line, followed by a segment with text 'It's been a great month!' and another with 'You're at ((#)) Leads'.

    If you have further questions, please update the support case that you have created.

    Cheers,

    Caterina

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 10:24 AM (GMT 0) on 4 Mar 2024]