Re: [poedit-users] Custom Source Parser

Christian <[email protected]> Fri, 29 Feb 2008 00:36:09 +0000 (UTC)
Newsgroups gmane.editors.poedit.user
Message-ID <[email protected]>
Christian <runeborg@...> writes:

> 
> Vaclav Slavik <vslavik@...> writes:
> 
> > 
> > Christian wrote:
> > > I'm wondering if it's the piping that may be what's causing this
> > 
> > Yes. The commands aren't ran through shell. Try using sh -c 'your 
> > command goes here' instead (no guarantees it will work, though).
> > 
> > Vaclav
> > 
> 
> I tried that as well, but I got this error message:
> 00:34:11: sh: line 1: xgettext: command not found
> 
> How are the commands run? If I run it through system(...) in php it works.
> Maybe if I know how the are run I can find a way to bypass this. Or do you
> have any suggestion as to how this can be solved, directing the tsmarty2c
> through xgettext?
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> 

Ok, I solved it (thanks to Olle), what was missing was the full path to xgettext
since sh didn't seem to have access to the paths :)

So the final command to run in the poEdit Parser command is:
sh -c 'php /path/to/tsmarty2c.php %F | /path/to/xgettext --force-po -o %o %K %C
-LC --add-comments --no-location -'

add-comments and no-location is needed since it reads from stdin, instead it
takes the comment generated from tsmarty2c.

Thanks for the help :)




-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/