@@ -26,6 +26,81 @@ wp i18n
2626
2727
2828
29+ ### wp i18n audit
30+
31+ Audit strings in a project.
32+
33+ ~~~
34+ wp i18n audit <source> [--slug=<slug>] [--domain=<domain>] [--ignore-domain] [--include=<paths>] [--exclude=<paths>] [--skip-js] [--skip-php] [--skip-blade] [--skip-block-json] [--skip-theme-json] [--format=<format>]
35+ ~~~
36+
37+ Scans PHP, Blade-PHP and JavaScript files for translatable strings to find possible mistakes.
38+
39+ ** OPTIONS**
40+
41+ <source>
42+ Directory to scan for string extraction.
43+
44+ [--slug=<slug>]
45+ Plugin or theme slug. Defaults to the source directory's basename.
46+
47+ [--domain=<domain>]
48+ Text domain to look for in the source code, unless the `--ignore-domain` option is used.
49+ By default, the "Text Domain" header of the plugin or theme is used.
50+ If none is provided, it falls back to the project slug.
51+
52+ [--ignore-domain]
53+ Ignore the text domain completely and extract strings with any text domain.
54+
55+ [--include=<paths>]
56+ Comma-separated list of files and paths that should be used for string extraction.
57+ If provided, only these files and folders will be taken into account.
58+
59+ [--exclude=<paths>]
60+ Comma-separated list of files and paths that should be ignored for string extraction.
61+ For example, `--exclude=.github,myfile.php` would ignore any strings found within `myfile.php` or the `.github`
62+ folder. Simple glob patterns can be used, i.e. `--exclude=foo-*.php` excludes any PHP file with the `foo-`
63+ prefix. Leading and trailing slashes are ignored, i.e. `/my/directory/` is the same as `my/directory`. The
64+ following files and folders are always excluded: node_modules, .git, .svn, .CVS, .hg, vendor, *.min.js, test, tests.
65+
66+ [--skip-js]
67+ Skips JavaScript string extraction.
68+
69+ [--skip-php]
70+ Skips PHP string extraction.
71+
72+ [--skip-blade]
73+ Skips Blade-PHP string extraction.
74+
75+ [--skip-block-json]
76+ Skips string extraction from block.json files.
77+
78+ [--skip-theme-json]
79+ Skips string extraction from theme.json files.
80+
81+ [--format=<format>]
82+ Output format for the audit results.
83+ ---
84+ default: plaintext
85+ options:
86+ - plaintext
87+ - json
88+ - github-actions
89+ ---
90+
91+ ** EXAMPLES**
92+
93+ # Audit a plugin for possible translation issues.
94+ $ wp i18n audit wp-content/plugins/hello-world
95+
96+ # Audit a plugin and output results as JSON.
97+ $ wp i18n audit wp-content/plugins/hello-world --format=json
98+
99+ # Audit a plugin with GitHub Actions annotations format.
100+ $ wp i18n audit wp-content/plugins/hello-world --format=github-actions
101+
102+
103+
29104### wp i18n make-pot
30105
31106Create a POT file for a WordPress project.
0 commit comments