WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.35k stars 4.13k forks source link

Missing Webpack Automation in Text Domain, Checktextdomain and Makepot Management with WordPress Scripts #62820

Closed aminul-xs closed 1 month ago

aminul-xs commented 2 months ago

The current configuration for addtextdomain, checktextdomain, and makepot tasks lacks integration with Webpack, which is essential for automating the process in modern JavaScript projects like Gutenberg. addtextdomain Configured to update text domains in PHP files, excluding node_modules. checktextdomain Ensures correct text domains in PHP files with specified keywords. makepot Generates POT files for internationalization, with options for project type and file updates.

Proposed Solution

To enhance automation and ensure comprehensive text domain management, integrate Webpack into the existing workflow .

Integrate Webpack: Configure Webpack to handle JavaScript and PHP files. Use plugins like wp-i18n for text domain handling in JavaScript files.

Update Configuration Files: Modify the webpack.config.js to include text domain management. Ensure compatibility with existing Webpack tasks for seamless operation.

Documentation and Testing: Thoroughly test to ensure no disruption in existing processes. This integration will modernize the automation process, ensuring consistent text domain management across all file types in the Gutenberg project. WordPress Scripts

swissspidy commented 1 month ago

It's not clear to me what you are actually proposing 🤔 There are no "addtextdomain" or "checktextdomain" tasks in this repo nor in @wordpress/scripts.

There is no need for @wordpress/scripts to have more i18n utilities, as string extraction is typically handled by WP-CLI. Validating and fixing the text domain is covered by ESLint and PHPCS.