This PR adds a composer script to generate POT files.
Technical Details
Utilize the wp-cli/i18n-command tool for the generation of POT files, as it is the official tool capable of translating both PHP and JS files. Given that Gutenberg introduced localization functions in JS files, this tool ensures comprehensive coverage.
The generation process will result in the creation of a POT file within the languages directory.
Abstain from creating a GitHub action workflow for POT file generation due to the resource-intensive nature of the task, involving both high memory and CPU usage. This complexity can lead to potential failures within the GitHub action workflow.
Commands
Run composer run pot to generate POT files.
Run npm run pot to generate POT file. It's an alias to composer run pot.
Description
This PR adds a composer script to generate POT files.
Technical Details
Utilize the wp-cli/i18n-command tool for the generation of POT files, as it is the official tool capable of translating both PHP and JS files. Given that Gutenberg introduced localization functions in JS files, this tool ensures comprehensive coverage.
The generation process will result in the creation of a POT file within the
languages
directory.Abstain from creating a GitHub action workflow for POT file generation due to the resource-intensive nature of the task, involving both high memory and CPU usage. This complexity can lead to potential failures within the GitHub action workflow.
Commands
composer run pot
to generate POT files.npm run pot
to generate POT file. It's an alias tocomposer run pot
.How to test
npm install
to install JS packages.composer update
to install PHP packages.npm run init
to initialize the plugin.composer run pot
to generate POT file.Fixes/Covers issue
Fixes #87
Reference
https://github.com/rtCamp/features-plugin-skeleton/pull/482