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

50 Mb limit fix suggestion. #88

Open JalmarazMartn opened 3 years ago

JalmarazMartn commented 3 years ago

About 50 mb file limit, I can tell you that I developed too a xliff help extension(I won´t put here the link because I don´t want to be a spammer) , and I had the same issue. I think the problem is using in xlf-document.ts class, function loadFromURI the sentence workspace.openTextDocument(sourceUri)).getText(); Instead using openTextDocument you can use:

   var fs = require('fs');
    const content = fs.readFileSync(FilePath,{encoding:'utf8', flag:'r'});

If you need a further split this content into lines you can do this: const Lines = content.split('\r\n');

I am not sure 100 % you can fix the issue this way, but I remember this issue.

I hope this can help. Thank you for your extension.

rvanbekkum commented 3 years ago

Dear @JalmarazMartn,

Yes, that's an option to address this. I've had this on my internal backlog (in my head 🙃), but it is something that I have to put some time in to carefully adjust. I will most likely change this in a future update. Thanks for filing the issue. 😊

JalmarazMartn commented 3 years ago

Thank you for your extension @rvanbekkum . Have a nice day!!

rvanbekkum commented 3 years ago

We can leave it open. After I've implemented this I will close the issue accordingly. 🙂

pri-kise commented 2 years ago

Today I stumbled again about this error. Maybe you can at least add a try catch block with a warning that large files aren't supported right now. At the moment nothing happens and the user don't know what happened. image