Developer comments not escaped in Structured JSON (translator mode)

Hello!

I’m noticing that when I download Structured JSON using translator mode, developer comments are not escaped for JSON. That is, developer comments seem to be included as-is without any escaping. This results in invalid JSON that I cannot use in my application. I see this both when I download the JSON using the client and when I download it from the Transifex website in a browser.

I believe that the translations are still being escaped. That is, the value of the string property seems to be escaped. However, the value of the developer_comment property is not escaped.

Thank you, and please let me know if I can provide any additional information!

Hello Matthew,

Thanks for reaching out to Transifex support.
I tried to reproduced the scenario you mentioned without any luck, Let me give you a little bit more context on what I did.
This is how my original file looks like, As you can see, here I scaped the quotes with a single back slash before each quote:

Now, To download the file I used API v3 using the following endpoints.
To create a download action: “https://rest.api.transifex.com/resource_translations_async_downloads
and to get the content “https://rest.api.transifex.com/resource_translations_async_downloads/{resource_translations_async_download_id}
As you can see on the following image I set the request in translator mode:


And this is how the response looks:

Please let me know if Im missing something.

Best Regards
Cesar

“developer_comment”: "This is a pluralized string with special character & “test” with quotes ",

Hi @Cesar_Garcia! Thank you for looking into this. I tried what you suggested, and I do see that when I download translations using the API, developer comments are escaped.

However, the resulting download is structured very differently from the translations I have downloaded in the past. For example, the object is flat (there is no nesting), and plural strings do not use ICU plurals and are instead objects.

When I download translations from the Transifex website, they match the structure I expect. To do so, I navigate to my resource, click a language, then click “Download file to translate”. However, in this format, developer comments are not escaped. I see the same thing when I run tx pull using the Transifex Client.

Are you able to reproduce this behavior if you use the Transifex website or the Transifex Client?

Thank you again for your assistance!

Hello Matthew,

Allow me to chime in here, since Cesar, is out of the office. regarding your case, could you please share with me or send it to support@transifex.com the URL of the resource you are referring to.
I tested the following example in a test project of mine

{
   "parent_key":{
      "child_key":{
         "string":"This is a key from a child",
         "context":"Noun",
         "developer_comment":"This is a comment's.\n This is another \"comments\" line",
         "character_limit":150
      }
   }
}

and the file uploaded with Structured JSON parser like this one
image

Also, I downloaded the file with the option “Download file to translate” and I got the following result.

So, I would like to share with me the initial resource file, the version of your TX client, you can find it with the following command
tx --version

And a copy of the old files you were received in the past as you mentioned that was very different.

Looking forward to your response.

Kind regards,
Panagiotis

1 Like

Hi @Panagiotis_Kavrakis! Thank you for your reply. When I download translations today, developer comments are escaped. That’s true both when I use the Transifex website and when I use the Transifex Client. That means that everything is working now with our workflow.

Thank you again for your assistance!

Hello Mattherw,

Thats great to read, In case you encounter any other issues feel free to reach us out :slight_smile:

Best Regards
Cesar

1 Like