wp-cli / i18n-command

Provides internationalization tools for WordPress projects.
MIT License
96 stars 52 forks source link

wp i18n make-pot not looking for strings in build? #337

Closed sanzeeb3 closed 2 years ago

sanzeeb3 commented 2 years ago

When I created a pot file with wp i18n make-pot command, it doesn't look for strings in the build directory and only looks for source directory.

Currently, it only shows the string in the source directory. Example. src/edit.js:905, but not dist/index.js:1

#: assets/block/src/edit.js:905
msgid "General:"
msgstr ""

instead of expected:

#: assets/block/dist/index.js:1
#: assets/block/src/edit.js:905
msgid "General:"
msgstr ""

The build is created using 'wp-scripts'. Example:

  "scripts": {
    "build": "wp-scripts build assets/block/src/index.js --output-path=assets/block/dist",

Here src is source dist is build. Is there anything else I should include or is it excluded by default?

On debug, it does show:

Debug: Parsing file assets/block/dist/index.js (0.531s)

sanzeeb3 commented 2 years ago

Found out I was on a lower version of wp-cli. Updating to the latest version fixed the issue.