rvanbekkum / vsc-xliff-sync

Visual Studio Code extension that allows for automatic merging of (simple) XLIFF translation files.
MIT License
23 stars 4 forks source link

Cannot escape "Parse From Developer Note Separator" #115

Open yurim108 opened 1 year ago

yurim108 commented 1 year ago

Pipeline (|) is setup as a default separator. How to deal with the situation when the pipeline must be included into translation (in the middle of a running project)?

Example: ConfigFileFilterLbl: Label 'JSON files (.json)|.json|All files (.)|.', Comment = 'de-DE=JSON Dateien (.json)|.json|Alle Dateien (.)|.';

Changing default separator would mean that we need to check all other existing translations, whether they include the new separator.

Suggested solution: when the separator occures twice (||) then treat it as a single pipeline without separator functionality. In this case one would have to escape the pipeline in the translated text like this:

ConfigFileFilterLbl: Label 'JSON files (.json)|.json|All files (.)|.', Comment = 'de-DE=JSON Dateien (.json)||.json||Alle Dateien (.)||.';

Another solution would be to define a line specific separator like this: ConfigFileFilterLbl: Label 'JSON files (.json)|.json|All files (.)|.', Comment = 'Separator=##de-DE=JSON Dateien (.json)|.json|Alle Dateien (.)|.#fr-FR=.......';

rvanbekkum commented 1 year ago

Dear @yurim108,

Thank you for your issue. Sorry about the later reply.

I think your second suggestion might work best. What do you think yourself? I will have a look at it.

yurim108 commented 1 year ago

Dear Rob,

I have solved it for now by using double pipeline as a separator. I would also go with the 2nd option.

It would be nice to get a warning, if the source text contains separator (in case when the separator is redefined in the line, the new check should use the redefined separator).