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

Error syncing Angular translations #2

Closed
simooo985 opened this issue Nov 26, 2020 · 3 comments
Closed

Error syncing Angular translations #2

simooo985 opened this issue Nov 26, 2020 · 3 comments
Labels
bug Something isn't working shipped Issue is available in the public release.

Comments

@simooo985
Copy link

Hi, first of all thank you for this very useful tool.
It happens something strange when i try to use it. I have and angular application and i extracted an xlf file named messages.xlf using ng i18n-extract ( it is the file attached to the issue ), i copied and renamed it into messages.it.xlf. Then i run ng i18n-extract again because some translations have been added to the app, so the messages.xlf now contains more entries. Here comes xliff sync tool: when i run

Sync-XliffTranslations -sourcePath "src\locale\messages.xlf" -targetPath "src\locale\messages.it.xlf"

the file messages.it.xlf is correctly merged, but in the console i get a lot of errors like this

Exception calling "ImportNode" with "2" argument(s): "Cannot import a null node."
At C:\Program Files\WindowsPowerShell\Modules\XliffSync\1.0.0.0\Model\XlfDocument.ps1:509 char:21

  • ... $newWhiteSpaceNode = $this.root.OwnerDocument.ImportNode( ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : DotNetMethodException

why? how can i get rid of these errors?

Thank you very much in advance

messages.zip

@rvanbekkum
Copy link
Owner

Hi @simooo985,
Thank you for filing the issue and providing an example. I will check what the problem is. 😉

@rvanbekkum rvanbekkum added bug Something isn't working investigate Needs some investigation labels Nov 26, 2020
@rvanbekkum
Copy link
Owner

Hi @simooo985,
A bit of a late reply, but I found out what the issue is.
The module was build specifically for files from the XLIFF Generator that ships with the "AL Compiler for Microsoft Dynamics 365 Business Central apps". The thing is, in these XLIFF files the xml:space="preserve" attribute is added to trans-units and so the NextSibling-method also treats whitespace as siblings. The PowerShell module was built with the assumption of this always being the behaviour of the NextSibling/PreviousSibling method, but that is not the case.
I will make a change to take this attribute into account.

@rvanbekkum rvanbekkum added ships-in-future-update Resolution will be available in the next release. and removed investigate Needs some investigation labels Mar 6, 2021
@rvanbekkum
Copy link
Owner

This has been resolved in v1.1.0.0 which is now available. Thank you for filing the issue!

@rvanbekkum rvanbekkum added shipped Issue is available in the public release. and removed ships-in-future-update Resolution will be available in the next release. labels Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working shipped Issue is available in the public release.
Projects
None yet
Development

No branches or pull requests

2 participants