-
Notifications
You must be signed in to change notification settings - Fork 2
Refine the options passed to the make-pot
command
#304
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
Conversation
This adds the `node_modules` and `wordpress` directories to the exclude list for the `make-pot` command. Because WordPress is installed as a Composer dependency, the strings in WordPress Core could unintentionally be included in translation files when a text domain is missing. There should not be any strings that need translating in these directories, so excluding them saves time and is more performant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refines the --exclude
option for the make-pot
command by adding node_modules
and wordpress
directories to the exclusion list. This prevents WordPress Core strings from being unintentionally included in translation files when text domains are missing, improving performance and avoiding incorrect string extraction.
- Adds
node_modules
andwordpress
to the exclude list for the i18n pot generation command - Prevents inclusion of WordPress Core strings in translation files
- Improves performance by excluding unnecessary directories during string extraction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe vendor and node_modules are both excluded by default, but no problem to include them here too.
Ah yes, you're right! I think it is better to not include them. We should remove these where they are listed instead. |
These are excluded by default.
--exclude
option for make-pot
make-pot
command
Proposed changes
This makes a few changes to the
make-pot
command:wordpress
directory to the exclude list for themake-pot
command: Because WordPress is installed as a Composer dependency, the strings in WordPress Core could unintentionally be included in translation files when a text domain is missing (see Avoid translating installed dependencies wp-module-help-center#218).--domain
: The default value for--domain
is the project slug whenText Domain
is not specified in the main plugin or theme file. Explicitly passing the text domain avoids the scenario where someone checks the repository out in a folder with a custom name.Type of Change
Production
Development
Visual
Checklist
Further comments