Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoded characteres are being decoded after commit #7729

Closed
2 tasks done
danjor opened this issue Jun 1, 2022 · 2 comments
Closed
2 tasks done

Encoded characteres are being decoded after commit #7729

danjor opened this issue Jun 1, 2022 · 2 comments
Labels
enhancement Adding or requesting a new feature. translate-toolkit Issues which need to be fixed in the translate-toolkit wontfix Nobody will work on this.

Comments

@danjor
Copy link

danjor commented Jun 1, 2022

Hello,

I'm using XLF files with a git repository.
After exporting, encoded characters are being decoded.
I'm expecting them to not be decoded and stay encoded.

First I import the XML file with encoded characters by using Pull repository :

<trans-unit id="1976632937776863230" datatype="html">
        <source>The modification operation of this domain is not allowed. A syntax error occurred in the value of the &quot;Remote Service Provider Metadata&quot; attribute.</source>
        <target state="translated">L&apos;opération de modification de ce domaine n&apos;est pas autorisée. Une erreur de syntaxe s&apos;est produite dans la valeur de l&apos;attribut &quot;Metadata du fournisseur de service distant&quot;.</target>
        <note priority="1" from="description">Detailed error when saml meta data is not well formatted</note>
</trans-unit>

Then after exporting :

<trans-unit id="1976632937776863230" datatype="html">
        <source>The modification operation of this domain is not allowed. A syntax error occurred in the value of the "Remote Service Provider Metadata" attribute.</source>
        <target state="translated">L'opération de modification de ce domaine n'est pas autorisée. Une erreur de syntaxe s'est produite dans la valeur de l'attribut "Metadata du fournisseur de service distant".</target>
        <note priority="1" from="description">Some info</note>
</trans-unit>

Before importing :

  • double quote " where encoded with &quot;
  • single quote ' where encoded with &apos;

After exporting :

  • encoded double quote &quot; where decoded with "
  • encoded single quote &apos; where decoded with '

This behavior seems to appen only for text nodes.
If source and target contains interpolation, equiv-text attribute is still encoded, which is correct.

<source>Someone&apos;s<x id="CLOSE_LIST_ITEM" ctype="x-li" equiv-text="&lt;/li&gt;"/></source>
<target>Someone&apos;s<x id="CLOSE_LIST_ITEM" ctype="x-li" equiv-text="&lt;/li&gt;"/></target>

to

<source>Someone's<x id="CLOSE_LIST_ITEM" ctype="x-li" equiv-text="&lt;/li&gt;"/></source>
<target>Someone's<x id="CLOSE_LIST_ITEM" ctype="x-li" equiv-text="&lt;/li&gt;"/></target>

Encoded characters should remain as is and stay encoded.

Is this configurable somewhere or is there something that should be change in the code to handle this ?

At least, source tag content should not be modified.

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

  1. Go to '...'
  2. Scroll down to '...'
  3. Click on '...'
  4. See error

Expected behavior

No response

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

4.12.2

Weblate deploy checks

No response

Additional context

No response

@nijel
Copy link
Member

nijel commented Jun 1, 2022

This is currently not configurable, the behavior is hard-coded in the translate-toolkit.

@nijel nijel added enhancement Adding or requesting a new feature. wontfix Nobody will work on this. translate-toolkit Issues which need to be fixed in the translate-toolkit labels Jun 1, 2022
@github-actions
Copy link

github-actions bot commented Jun 1, 2022

The issue you've reported needs to be addressed in the translate-toolkit. Please file the issue there, and include links to any relevant specifications about the formats (if applicable).

@nijel nijel closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2022
@nijel nijel mentioned this issue Jun 1, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature. translate-toolkit Issues which need to be fixed in the translate-toolkit wontfix Nobody will work on this.
Projects
None yet
Development

No branches or pull requests

2 participants