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

Hotfix - Improve the rebuilding of target XLF files #7

Merged
merged 2 commits into from
Jul 7, 2023

Conversation

didier-84
Copy link
Collaborator

We rewrote the writeTargetFiles method in base.js to iterate on existing XML trans-units (based on the source XLF file) instead of iterating on the segments from the Translation.io response.

This ensures that all XML trans-units for which we compute the same uniqueIdentifier will be filled with the same target from the Translation.io response.

This fix is put in place after one of our users noticed that some XML trans-units were not filled with the target during a sync.
Indeed, the angular i18n-extractor creates two separate trans-units for sources that "seem" identical but are actually padded with spaces:

<p i18n>Example</p>

<div>
    <p i18n>
      Example
    </p>
</div>

Our package purposely trims any leading or trailing space when processing sources, so this results in only one segment being sent to Translation.io.

@MichaelHoste MichaelHoste merged commit 0bf6b1c into master Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants