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

Not copying source text completely when there is an "x" node in it and using "-copyFromSource" #34

Open
gergely-gyorgy-both opened this issue Oct 28, 2022 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@gergely-gyorgy-both
Copy link

I have a messages.xlf file generated by angular, which has several sources, where there are <x/> nodes inside the source:
<source><x id="PH" equiv-text="olderThanParam"/> day</source>.
When using -copyFromSource param to copy this to the messages.en-US.xlf file, the source is copied just fine, but the target is either incomplete or completely missing.
If the x node is in the beginning of the source, it is missing completely, if it's in somewhere in the source (but not at the start), the target gets filled until the x node.

<source><x id="PH" equiv-text="olderThanParam" /> day</source>
<target state="needs-translation" />

<source>Should have <x id="PH" equiv-text="olderThanParam" /> days</source>
<target state="translated">Should have </target>

Command used: Sync-XliffTranslations -sourcePath "messages.xlf" -targetPath "messages.en-US.xlf" -copyFromSource

The messages.xlf generating this problem:

<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
  <file source-language="dev" datatype="plaintext" original="ng2.template">
    <body>
    <trans-unit id="startWithXNode" datatype="html">
      <source><x id="PH" equiv-text="olderThanParam"/> day</source>
      <context-group purpose="location">
        <context context-type="sourcefile">src/app/overview/component/current-status/current-status-advanced-filter/current-status-advanced-filter.component.ts</context>
        <context context-type="linenumber">276</context>
      </context-group>
    </trans-unit>
    <trans-unit id="hasXNodeInTheMiddle" datatype="html">
      <source>Should have <x id="PH" equiv-text="olderThanParam"/> days</source>
      <context-group purpose="location">
        <context context-type="sourcefile">src/app/overview/component/current-status/current-status-advanced-filter/current-status-advanced-filter.component.ts</context>
        <context context-type="linenumber">276</context>
      </context-group>
    </trans-unit>
    </body>
  </file>
</xliff>
@rvanbekkum rvanbekkum added bug Something isn't working enhancement New feature or request labels Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants