Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use offical WP-CLI i18n package to generate POT file. #88

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mi5t4n
Copy link
Member

@mi5t4n mi5t4n commented Nov 30, 2023

Description

This PR adds a composer script to generate POT files.

Technical Details

  1. 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.

  2. The generation process will result in the creation of a POT file within the languages directory.

  3. 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

  1. Run composer run pot to generate POT files.
  2. Run npm run pot to generate POT file. It's an alias to composer run pot.

How to test

  1. Run npm install to install JS packages.
  2. Run composer update to install PHP packages.
  3. Run npm run init to initialize the plugin.
  4. Run composer run pot to generate POT file.

Fixes/Covers issue

Fixes #87

Reference

https://github.com/rtCamp/features-plugin-skeleton/pull/482

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update POT generation using official WP CLI package.
1 participant