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

Fix splitting if the separator consists of more than one character #29

Merged
merged 1 commit into from
Jan 27, 2022

Conversation

DavidFeldhoff
Copy link
Contributor

Hi Rob,

we're using the following command in our pipeline

Sync-XliffTranslations -sourcePath ".\Core.g.xlf" -targetLanguage 'de-DE' -parseFromDeveloperNote -parseFromDeveloperNoteOverwrite -parseFromDeveloperNoteSeparator "||" -detectSourceTextChanges:$false

The issue is that the separator consists of more than one character, because the powershell $string.Split('text') function splits the $string-variable by each character (= by t, e, x, and t).
So in our example:

HTMLFileTypeTok: Label 'HTML Files (*.html)|*.html', Comment = 'de-DE=HTML-Dateien (*.html)|*.html';

The result of "de-DE=HTML-Dateien (*.html)|*.html".Split('||') is de-DE=HTML-Dateien (*.html) which is wrong and unfortunately in this case we're using it as filter for a file dialog, so the wrong translation leads to a runtime error.

Best regards
David

@DavidFeldhoff
Copy link
Contributor Author

Ah and I think it's worth to mention that it works perfectly fine in VS Code in the extension, so it's just the powershell module that's acting weird here :)

@rvanbekkum rvanbekkum merged commit 6076b9a into rvanbekkum:develop Jan 27, 2022
@rvanbekkum
Copy link
Owner

Hi David,
Thanks for the detailed explanation and for filing a PR for adding support for a separator that consists of multiple characters! 😊
PR merged!

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