grunt-pot icon indicating copy to clipboard operation
grunt-pot copied to clipboard

msgmerge not updating PO files

Open enventa opened this issue 7 years ago • 3 comments

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!

enventa avatar May 06 '17 11:05 enventa

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).

stephenharris avatar May 08 '17 08:05 stephenharris

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!

enventa avatar May 08 '17 08:05 enventa

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.

harrilehtisaari avatar Oct 26 '17 10:10 harrilehtisaari