rvanbekkum / vsc-xliff-sync

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

Option to not add entries into xlf for which translation is missing #121

Closed andreasblueher closed 3 weeks ago

andreasblueher commented 1 month ago

Hello Rob,

thank you very much for the effort you put into this extension, it has been really useful to me and my colleagues. We're currently in a situation where we have a few objects (reports to be more specific) which need to be translated in more than 2 languages, while all the major objects like tables and pages are only translated for german and english.

So when we use the extension and create an xlf for any other language a lot of entries are added with "needs-translation" which bloat the xlf file up to multiple megabytes for 15 languages, which bloats our app. So I was wondering if it's possible to add a configuration to add only those translations which exist for the selected language? I have looked at all the options and couldn't find one like that.

Sorry if my explanation is not the best, but english is not my first language.

rvanbekkum commented 1 month ago

Hi Andreas,

Thank you, nice to hear that you like the functionality of the extension. 😊

I think I grasp most of the idea / what you are asking for. The intent of "XLIFF Sync" is to synchronize the translation units from the base (.g.xlf) file to the other translation files. When we are talking about AL apps, the base .g.xlf file is generated while building the extension and it will include all translatable texts. At the same time you are saying you do translate everything but only in German (de-DE). But you would like to have an option that for some other languages you do not need to provide all translations AND not have XLIFF Sync synchronize all translation units for those other languages.

It seems a bit tricky, and there are multiple ways/directions this could be approached, but I am not sure about the best way.

I know that in AL code you can add , Locked = true, but that prevents the translation unit from even getting into the .g.xlf file and makes it that it cannot be translated at all. What we have here is what we could treat as a "Locked for all languages except for ..." With that, one approach/direct could be to 'abuse' the Comment property and let you put the languages there for which you require a translation (e.g., Caption = 'My Caption', Comment='LanguageFilter=de-DE|nl-NL' if you only want to translate for de-DE and nl-NL). But like I said, I am not sure yet if that would be the best approach/direction for a solution.

Could you share your suggestions with me on how you think this could be approached if we would like to make this possible?