Closed aminul-xs closed 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.
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