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

Sync-XliffTranslations: xml attribute target-language cannot be found #30

Closed
tpokorra opened this issue Mar 24, 2022 · 2 comments · Fixed by #31
Closed

Sync-XliffTranslations: xml attribute target-language cannot be found #30

tpokorra opened this issue Mar 24, 2022 · 2 comments · Fixed by #31
Labels
bug Something isn't working shipped Issue is available in the public release.

Comments

@tpokorra
Copy link
Contributor

When running Sync-XliffTranslations, for a language where there is no translation file yet, I get this error:

>> Sync-XliffTranslations -sourcePath "$GeneralXlf" -targetLanguage "de-DE" -findByXliffGeneratorNoteAndSource -findByXliffGeneratorAndDeveloperNote -findByXliffGeneratorNote
Loading source document C:\...\Translations\My Extension.g.xlf
Creating new document for language 'de-DE'
Ausnahme beim Festlegen von "target-language": "Die Eigenschaft "target-language" wurde für dieses Objekt nicht gefunden. Vergewissern Sie sich, dass die Eigenschaft vorhanden ist und festgelegt werden kann."
In C:\Program Files\WindowsPowerShell\Modules\XliffSync\1.6.0.0\Model\XlfDocument.ps1:707 Zeichen:17
+                 $newFileNode.'target-language' = $language;
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], SetValueInvocationException
    + FullyQualifiedErrorId : ExceptionWhenSetting

Es ist nicht möglich, eine Methode für einen Ausdruck aufzurufen, der den NULL hat.
In C:\Program Files\WindowsPowerShell\Modules\XliffSync\1.6.0.0\Public\Sync-XliffTranslations.ps1:126 Zeichen:5
+     [string] $language = $targetDocument.GetTargetLanguage();
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Creating Maps in memory for target document's units.

Translation of the error message: The propery "target-language" was not found for this object. Please make sure that the property exists and can be set.

Also, if I have generated the translation file in VSCode, and then run the powershell script, the attribute target-language disappears from the translation file.

tpokorra added a commit to tpokorra/ps-xliff-sync that referenced this issue Mar 24, 2022
@rvanbekkum rvanbekkum added the bug Something isn't working label Mar 25, 2022
@rvanbekkum
Copy link
Owner

Thank you for filing the issue and for your PR! 😊

@rvanbekkum rvanbekkum reopened this May 30, 2022
@rvanbekkum rvanbekkum added ships-in-future-update Resolution will be available in the next release. shipped Issue is available in the public release. and removed ships-in-future-update Resolution will be available in the next release. labels May 30, 2022
@rvanbekkum
Copy link
Owner

The fix for this bug has been shipped with 1.7.0.0!

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

Successfully merging a pull request may close this issue.

2 participants