stephenharris / grunt-pot

Scan files and creates a .pot file using xgettext
MIT License
53 stars 13 forks source link

msgmerge not updating PO files #17

Open enventa opened 7 years ago

enventa commented 7 years ago

Hi @stephenharris!

great plugin! I'm just having trouble updating .PO files. I set msgmerge: true but no update is happening.

GNU gettext tools are in my system (Windows 8.1) and in PATH.

I added some log messages to your "pot.js" file so I can trace if execution goes through your code... and it does! But exec( 'msgmerge -U ' + poFile + ' ' + potFile, function(error, stdout, stderr) {} ); seems to do nothing.

No error is thrown and the process finishes with an exit code of 0.

If I manually execute the command msgmerge -U fileNme.po fileName.pot from Win command line... it works, .PO files get updated.

Any idea what I'm missing??

Thank you very much!

stephenharris commented 7 years ago

Does the executed script match exactly the command you've tried manually? My only thought is that the values of poFile or potFile are not what they should be / you expect them to be...

(Clutching at straws, to be honest, because I can't replicate the issue. I've not tested it on Windows, so there's every possibility it is related to the operating system - but I would have expected an error message in such instance).

enventa commented 7 years ago

Hi @stephenharris, thanks for answering!

Yes, the command I tried is exactly the same that your task "pot.js" file should be executing. I know that because I outputted poFile and potFile values to the log console. And I also executed from the path where my "gruntfile.js" is placed.

Just for testing purposes, I have tried the solution that @tivnet proposes in issue #11... and it worked! So my guess the issue comes from exec and asynchronous execution, not from msgmerge command... which is not even called. There might be a dependency we are missing on Windows (I'm a Grunt newbie)?

Thanks Stephen!

harrilehtisaari commented 6 years ago

We are having this exact issue on MacOS but only with one project where we can't figure out what's different (compared to others). What we've gathered is that poFile and potFile are correct. When we change the exec to: var test = exec( 'msgmerge -U ' + poFile +' ' + potFile, function(error, stdout, stderr) {}); console.log(test); magic happens and it works. So what we're thinking is it's an issue with async.