Quote escaping issue

Hi,

There is an issue with quote escaping.
Some language strings may contain quotes which should be escaped by a translator.

I am using this construction:
<a href=\"https://

But when I download the file from Transifex, I see such construction:
<a href=\\"_QQ_"https://

\" is being converted into \\"_QQ_"
and the translation falls.

Please check it out.

I have the same issue.
Quotes, newlines, and dots are wrongly encoded.

{
    "service_mail\\.banner\\.html_msg": {  // <-- dots
        "character_limit": null,
        "context": "service",
        "developer_comment": "",
        "string": "<p>Follow the link: <a href=\\\"{1}\\\">{1}</a></p>"  // <-- quotes
    },
    "service_mail\\.template\\.text_msg": {
        "character_limit": null,
        "context": "service",
        "developer_comment": "",
        "string": "{1}\\n\\n  ---------------------------------------------------------------------\\n\\n  {0}\\n"  // <-- new lines
    }
}

How do I get the same format as i used in the upload?

Hello ,

Thank you for contacting Transifex.

We have opened a ticket to our dev team and they will look into this so that our parser does not escape in this way these situations. we do not have an exact date that this will be resolved yet.

We will of course post an update when we have news.

Kind regards
Christos

I solved the issue by using parameter “data.attributes.mode” = “default” instead of “json”.

The “json” mode was causing the double escaping of characters.

Hello dear Michael ,

I am very glad we managed to sort this out .

I have also forwarded this observation to our devs for further investigation.

Kind regards
Christos

We have this issues too – @michael-wirth: where can I find this parameter settings?

This can be related to the mode (file type in the newest API version) they use when downloading the HTML resource via the API. When using this endpoint to fetch translations from a resource, you can select the desired file format for the output:

  1. Default Mode: Provides the file in its original format.
  2. XLIFF Mode: Offers the file in a translatable XLIFF format.
  3. JSON Mode: Delivers the translations in a JSON file format.

You can attempt to obtain your translation file in a different format and let me know if this resolves the issue. Please inform me if this clarifies the situation or if you need further information.

Thank you for your anwser.

Is it possible to change it for the download via web interface too?
Also there escaped quotation marks are converted into "_QQ_"

Hi @hekla

My name is Carlos from Transifex support, for the UI the only option to download translations is the

  • Download for use. Which includes only translated strings in the file
  • Download file to translate , where untranslated source strings show a blank translation field, where translations need to be added, and
  • Download for translation as XLIFF are for translators who wish to translate the files outside of Transifex.

Except from the third option the rest will download the translations in the original format that the file was uploaded

I’m attendant to your comments
Best regards,

Hello Carlos,

I’m working on the same project as @hekla (JEM event management for Joomla) and asking this question on his behalf:

We are using the tx client for downloading all translations. Does the tx client allow fetching the translations in various modes (Default, XLIFF, JSON)?
Or is there a project setting that defines the mode in which translations will be downloaded? (I didn’t find it when browsing our project page).

Thanks in advance for your assistance!

Hello @ernst67,

I am Antonis from the Customer Success team. I hope you’re well.

The options you mentioned (default, xliff, json) are indeed available through the CLI by using their corresponding flags --xliffand --json. You can find this information and additional details in our CLI documentation. These modes should be available for all file-based projects.

Please let me know if this helps!

Hello Mylon,

That’s great and it should help us out. I set up and tested but got…:
“Your plan does not support advanced API features”

Alas, I guess we need to find another solution.

Oh, that was when I used the --xliff flag. I just tried the --json flag and that worked.
My team member will test it.

Hello @ernst67,

Yes, this is expected. Converting a file from its original format to XLIFF is available from our Growth plan and up, as mentioned in our documentation.

Converting to JSON doesn’t have that limitation, so if either format works for you, you can use JSON, which is included in your organization’s plan.

I hope this helps!

1 Like