Theme Localization problem with yarn pot

You might have just needed to reload your terminal.


Did you finely made it on windows ?
I still have an error “The syntax of the command is incorrect” even after installing coreutils, findutils and gettext


No, I’m using Polylang so it wasn’t necessary. But in the long run I’ll setup Hackintosh because there is just too much trouble with Roots and windows or web dev in general.

Thanks for yout feedback.
Well, any help from the community would be appreciated to make it work on windows :slight_smile:

I’m getting the same error message on WSL:
xargs: xgettext: No such file or directory

Now I don’t really know my way around Linux but this seems to work:

I noticed that:
Doesn’t exist on my Ubuntu 18.04 WSL Installation. In fact, there is no ‘/opt/’ directory at all.

The closest thing folder I could find is here:

So I ran this command instead of the above PATH command:
echo ‘export PATH="/home/linuxbrew/.linuxbrew/Cellar/gettext/$PATH"’ >> ~/.bash_profile
And then restarted the WSL terminal.

Now yarn pot seems to run fine, asides from a couple of ‘unterminated string’ warnings in my blade files.

It’s probably not a great solution so if anyone can figure out why I don’t have ‘/opt/gettext/bin/’ then please let me know.


I’m running into the same issue on Windows. Yarn pot script fails with an exit code 1 (Incorrect syntax).

Any help would be greatly appreciated. Thanks.

For me, this still returns

xargs: xgettext: No such file or directory
error Command failed with exit code 127.

Any help appreciated.

ps: tried

echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.zshrc

(using oh my zsh)

and reloading, it works.

Hi, I’m on Windows and I do have the same problem.
Did you find a solution ?

I use WSL 2 now, hence all *nix/Ubuntu tools can be used.

Ok thx, I used Wp-cli

My script : “pot”: “wp i18n make-pot . resources/my-theme.pot”
Every yarn pot launch an update on my-theme.pot and generate my translation automaticly.
That my client can then used in locotranslate plugin.

I also use VSCode with WSL 2 remote extension. The build is much faster, and the site (Docker) also runs much faster on native WSL 2 *nix file system.

1 Like