Closed strarsis closed 10 months ago
With recent bud
the theme.json
can also be generated by bud
(which is the case by default).
For having an up-to-date theme.json
scanned by wp i18n
, the build
npm
script must run before the translate:pot
(or invoked by it) command. Or a separate script that makes bud
regenerate only the theme.json
could be added that can be invoked before translate:pot
(or by it).
@retlehs: Latest stable WP CLI appears to work fine with the used commands now, so this can be merged.
To make this more robust, bud
should re-generate the theme.json
before the translate:pot
script.
This can be achieved by just calling the build
script, but wouldn't be just re-generating the theme.json
be better than building the whole project? Then bud
needs a dedicated command that just re-generates the theme.json
(when theme.json
generation is enabled in bud
, otherwise it can be a no-op).
@kellymears: A dedicated command for bud
that only/specifically re-generates the theme.json
(or no-op if no theme.json
generation is enabled) would be great for this! That command would run before the translation scan, for the translation source strings in the theme.json
being up-to-date.
@retlehs, @kellymears: Current stable wp cli
2.8.1
contains a recent enough wp i18n
, so this PR can be merged now!
It turns out that when using
--include
withwp i18n
thetheme.json
file and thepatterns
directory need to be explicitly included, too, as those would be skipped otherwise.Edit: The latest
wp i18n
version (>=2.4.0
) is needed for some bugfixes of otherwise blocking bugs. Untilwp
CLI is also newly released with the newwp i18n
version bundled, the latestwp i18n
version can be installed independently from thewp
CLI version by usingwp package install wp-cli/i18n-command:dev-main
and then just using it as usual (wp i18n
). Edit (October 2023): Current stablewp cli
2.8.1
contains a recent enoughwp i18n
.