Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds more and improves existing translation related
npm
scripts:npm
scriptstranslate
: Runtranslate:pot
andtranslate:update
.This is used to update the
PO
files to the latest translatable strings in the theme.translate:pot
: Update the Poedit Template (POT
) file from the theme files.translate:update
: UpdatePO
translation files (for a specific locale, e.g.de_DE
) from the Poedit Template (POT
) file.translate:compile
: Runtranslate:js
andtranslate:mo
.This is used to compile all the
PO
files toJSON
andMO
for usage in PHP/JavaScript/WordPress.translate:js
: Generate the JavaScriptJSON
translation files fromPO
files, used by JavaScript related WordPress components like Gutenberg Blocks in the Gutenberg Editor.translate:mo
: CompilePO
translation files to compiled, efficientMO
files that are used by PHP/WordPress.Workflow:
npm run translate
to scan and update thePO
translation files from the theme.PO
translation files with a suitable program (usually PoEdit).npm run translate:compile
to compile thePO
translation files toMO
files that can be used by PHP/WordPress and to JavaScript JSON files that can be used by WordPress JavaScript (Gutenberg).WP CLI
i18n
supporting versionsWP CLI
i18n
has support for parsing out translation strings fromBlade-PHP
templates now.A new version of
wp-cli/i18n-command
that contains the merged PR should be released in the near future.In the meantime, installing
wp-cli/i18n-command
from the repository can be used to getPHP-Blade
support:When you have a
i18n
release newer than2.2.13
and WP CLI release newer than2.6.0
installed,PHP-Blade
support should be already included.You can use
wp i18n make-pot --help | grep blade
and check whetherblade
is mentioned.