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

When synchronizing the translation units, a translation is lost if it has at the beginning an interpolation #67

Closed
olalinv opened this issue Dec 10, 2020 · 6 comments · Fixed by #77
Labels
enhancement New feature or request shipped Issue is available in the public release.

Comments

@olalinv
Copy link

olalinv commented Dec 10, 2020

I´ve got this translation unit in messages.xlf:

<trans-unit id="CreateModal.MessageOK" datatype="html">
  <source>Ticket <x id="INTERPOLATION" equiv-text="{{createResponseOK.code}}"/> created successfully</source>
</trans-unit>

And this is the tranlation in messages.eu-ES.xlf:

<trans-unit id="CreateModal.MessageOK" datatype="html">
  <source>Ticket <x id="INTERPOLATION" equiv-text="{{createResponseOK.code}}"/> created successfully</source>
  <target state="translated"><x id="INTERPOLATION" equiv-text="{{createResponseOK.code}}"/> eskaera behar bezala sortu da</target>
</trans-unit>

By synchronizing the translation units again the translation becomes:

<trans-unit id="CreateModal.MessageOK" datatype="html">
  <source>Ticket <x id="INTERPOLATION" equiv-text="{{createResponseOK.code}}"/> created successfully</source>
  <target state="translated">Ticket </target>
</trans-unit>

If I put a space (or any word) just before the interpolation then this doesn't happen:
<target state="translated">&nbsp;<x id="INTERPOLATION" equiv-text="{{createResponseOK.code}}"/> eskaera behar bezala sortu da</target>

@rvanbekkum rvanbekkum added enhancement New feature or request investigate Needs some investigation labels Jan 24, 2021
@rvanbekkum
Copy link
Owner

Hi @olalinv,
Sorry for the late reply. I have looked into your issue, but I can't seem to reproduce it yet.
For me the translation does not disappear, however, what I do see is that the target node is being marked as a missing-translation. I can see why that happens and will look into fixing that.

However, that is not the bug you reported, so could you provide me with a sample project which reproduces this? (Maybe it is caused by specific settings.)

@rvanbekkum rvanbekkum added bug Something isn't working input-needed Extra attention is needed and removed enhancement New feature or request investigate Needs some investigation labels Feb 7, 2021
@rvanbekkum
Copy link
Owner

Back at it again. Found another example of reproducing this, which is when copyFromSource is used. The issue is that currently nodes nested in the target are not supported. I will look into this though.

@rvanbekkum rvanbekkum added enhancement New feature or request in-progress One of the contributors is working on this. and removed bug Something isn't working labels Feb 7, 2021
@olalinv
Copy link
Author

olalinv commented Feb 8, 2021

Hi @ rvanbekkum,

This is my settings file:

{ "xliffSync.baseFile": "messages.xlf", "xliffSync.addNeedsWorkTranslationNote": false, "xliffSync.copyFromSourceForLanguages": [ "ca-ES", "de-DE", "en-US", "eu-ES", "es-ES", "fr-FR", "gl-ES", "it-IT", "pt-PT" ], "xliffSync.detectSourceTextChanges": false }

I will try to prepare a sample project as soon as i can for further testing, if you need help please let me know.

Thanks

@rvanbekkum
Copy link
Owner

A change for this will be shipped in the next release of the extension!

@rvanbekkum rvanbekkum reopened this Feb 19, 2021
@rvanbekkum rvanbekkum added shipped Issue is available in the public release. ships-in-future-update Resolution will be available in the next release. and removed in-progress One of the contributors is working on this. input-needed Extra attention is needed shipped Issue is available in the public release. labels Feb 19, 2021
@rvanbekkum rvanbekkum removed the ships-in-future-update Resolution will be available in the next release. label Feb 21, 2021
@rvanbekkum
Copy link
Owner

Shipped in v1.0.0.

@rvanbekkum rvanbekkum added the shipped Issue is available in the public release. label Feb 21, 2021
@olalinv
Copy link
Author

olalinv commented Feb 22, 2021

I've tried it and it works perfectly. Thanks a lot.

This was referenced Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request shipped Issue is available in the public release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants