wp i18n make-pot
Create a POT file for a WordPress project.
Scans PHP and JavaScript files for translatable strings, as well as theme stylesheets and plugin files if the source directory is detected as either a plugin or theme.
--ignore-domain
option is used. By default, the "Text Domain" header of the plugin or theme is used. If none is provided, it falls back to the project slug.--subtract
!--include="src,my-file.php
will ignore anything besides my-file.php
and files in the src
directory. Simple glob patterns can be used, i.e. --include=foo-*.php
includes any PHP file with the foo-
prefix. Leading and trailing slashes are ignored, i.e. /my/directory/
is the same as my/directory
.--exclude=".github,myfile.php
would ignore any strings found within myfile.php
or the .github
folder. Simple glob patterns can be used, i.e. --exclude=foo-*.php
excludes any PHP file with the foo-
prefix. Leading and trailing slashes are ignored, i.e. /my/directory/
is the same as my/directory
. The following files and folders are always excluded: node_modules, .git, .svn, .CVS, .hg, vendor, *.min.js.#: filename:line
lines. Defaults to true, use --no-location
to skip the removal. Note that disabling this option makes it harder for technically skilled translators to understand each message’s context. ```
Copyright (C) 2018 Example Plugin Author
This file is distributed under the same license as the Example Plugin package.
```
If a plugin or theme specifies a license in their main plugin file or stylesheet, the comment looks like
this:
```
Copyright (C) 2018 Example Plugin Author
This file is distributed under the GPLv2.
```
Project-Id-Version
header. Overrides plugin or theme name, if applicable.# Create a POT file for the WordPress plugin/theme in the current directory
$ wp i18n make-pot . languages/my-plugin.pot
# Create a POT file for the continents and cities list in WordPress core.
$ wp i18n make-pot . continents-and-cities.pot --include="wp-admin/includes/continents-cities.php"
--ignore-domain
These global parameters have the same behavior across all commands and affect how WP-CLI interacts with WordPress.
Argument | Description |
---|---|
--path=<path> |
Path to the WordPress files. |
--url=<url> |
Pretend request came from given URL. In multisite, this argument is how the target site is specified. |
--ssh=[<scheme>:][<user>@]<host\|container>[:<port>][<path>] |
Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "vagrant"). |
--http=<http> |
Perform operation against a remote WordPress installation over HTTP. |
--user=<id\|login\|email> |
Set the WordPress user. |
--skip-plugins[=<plugins>] |
Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. |
--skip-themes[=<themes>] |
Skip loading all themes, or a comma-separated list of themes. |
--skip-packages |
Skip loading all installed packages. |
--require=<path> |
Load PHP file before running the command (may be used more than once). |
--exec=<php-code> |
Execute PHP code before running the command (may be used more than once). |
--context=<context> |
Load WordPress in a given context. |
--[no-]color |
Whether to colorize the output. |
--debug[=<group>] |
Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. |
--prompt[=<assoc>] |
Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. |
--quiet |
Suppress informational messages. |