An issue with parsing .json file that consists of a list of .jsons

Hi everyone, 

recently I encountered an issue with parsing a .json file. 

Here is how the file looks: 

Screenshot of a JSON file with multiple objects, highlighting the object with 'Name': 'AutoRunValidationError'. Fields like 'RibbonText', 'Notification', and 'Description' contain error messages.

This is a list of jsons within a json. Values for the following keys need to be localized: LanguageID, RibbonText, Notification, Buttons (if the strings is not "null"), Description, Subject and Value. 

Until now I have been using out of the box .json parser (Add-in JSON Parser). However, when the file was updated and a new .json (with the exact same structure) has been added to the file between already existing .jsons and, as a result I had a leverage loss. 

Below is a screenshot for visualization: 

Screenshot of a JSON file showing an object with 'Name': 'AutoRunValidationError' above and a new object 'AutoRunFailed' inserted below, indicated by a red arrow and text 'New .json was added here'.

Since the structure for all of the .jsons within this file is the same and there are no unique keys, new json jumped in the place of the one with name "AutoRunFailed". For Passolo, string IDs remained the same, but the source changed.  I lost leverage for everything that is below the red arrow (highlighted in yellow). Strings had the untranslated status and Passolo suggested teh old translations. 

I was able to recover my translations, by moving the new .json to the very end of the file and leveraging translation from a copy of Passolo project, however this is not a long term solution. The same issue will come up again when this file is updated. 

I contacted the support and they confirmed that there is no other way around. So we tried to come up with a custom txt parser. Using value for "Name"  as string ID (in yellow) for all of the values in green - screenshot below. 

Close-up of a JSON object with 'Name': 'AutoRunValidationError'. Fields such as 'RibbonText', 'Notification', and 'Description' are highlighted in green.

I managed to achieve that very easily with the first string (String id: "AutoRunValidationError" Parsed string: "1033"). Simply by doing the following:

 Screenshot of a Passolo 2022 parser configuration window with fields for string begins with, string ends with, and ID of string.

 

However I am stuck when I want to move on to the next strings.

With help from support I managed to set "AutoRunValidationError" as string id for "RibbonText" by doing the following: 

Screenshot of a Passolo 2022 parser configuration window showing a regular expression used to define the beginning of a string and the ID of the string.

 I tried to use the same rule and changing "RibbonText" with "Notification" and it simply does not work. Ans support is not able to help here. 

Does anyone has an idea how to make it work so that I can AutoRunValidationError set as string id for all the values that need to be localized? 

Or maybe we can achieve that with a different parser? 

I would very much appreciate your help with this ;)

I am using Passolo 2022



Generated Image Alt-Text
[edited by: RWS Community AI at 12:15 PM (GMT 1) on 13 Jun 2024]
emoji