Skip to content

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

@mi5t4n mi5t4n self-assigned this Nov 30, 2023
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.

2 participants