Customized JSON parsers

Hi all,

We'd like to enhance the JSON parser for Passolo: It seems to work well for JSON with the following very basic structure:

{

  "key1": "message 1",

  "key2": "message 2"

}

However, we would like to use something like this:

{ messages:[

  {

    "id": "key1",

    "text": "message 1",

    "other": "some other fields"

  },{

    "id": "key2",

    "text": "message 2",

    "other": "some other fields"

  }]

}

We are interested in the content of "id" and "text" which represents our key-value pair. The "other" fields should be ignored. Using the default parser, the example above will result in 6 Strings (id=key1, text=message 1, other=some other fields, ...) instead of two (key1=message 1, key2=message 2).

The JSON "Setup..." dialog in Passolo does not allow to define a template as for example the XML parser allows to. Is there a way to define a customized JSON parser?

Thanks and best regards

Dominic

Parents
  • This is not possible with the inbuilt JSON parser which just works with the basic key/value pair structure shown in the first sample. There is no configuration menu like with the XML parser.

    What you can do is implementing your own parser using the free SDL Passolo SDK that can be downloaded from the SDL developer page. Using such a self-developed parser you read the JSON file with standard .NET library functions, then extract your id and text content and pass it to Passolo for translation.

    If you don’t have the know-how or capacity to implement such a customized solution, you can search the internet as there are some provider that will offer development support.

Reply
  • This is not possible with the inbuilt JSON parser which just works with the basic key/value pair structure shown in the first sample. There is no configuration menu like with the XML parser.

    What you can do is implementing your own parser using the free SDL Passolo SDK that can be downloaded from the SDL developer page. Using such a self-developed parser you read the JSON file with standard .NET library functions, then extract your id and text content and pass it to Passolo for translation.

    If you don’t have the know-how or capacity to implement such a customized solution, you can search the internet as there are some provider that will offer development support.

Children