Loco Translate command line tools
As of version 2.4.5 Loco Translate includes commands accessible via WP-CLI.
Issue wp help loco
to see the available commands.
Sync command
This command performs Loco Translate's Sync function to update translation files when the available strings have changed.
You can filter the sync operation to a type of bundle:
wp loco sync plugins
or to a specific text domain:
wp loco sync loco-translate
and for specific locales:
wp loco sync themes --locale=de_DE
You can do a dry run to see what PO files would be updated, and see verbose output with the --debug
option:
wp loco sync --debug=loco --noop
See all options with:
wp help loco sync
Extract command
This command performs Loco Translate's string extraction function to update translation templates when source code has changed.
You can filter the extract operation to a type of bundle:
wp loco extract themes
or to a specific text domain:
wp loco extract loco-translate
You can do a dry run to see what POT files would be updated, and see verbose output with the --debug
option:
wp loco extract --debug=loco --noop
See all options with:
wp help loco extract
Notes
- These commands only perform direct file system writes. There are currently no remote access options.
- The commands do not currently print translated log messages. This feature is very new and susceptible to regular copy changes.
- We can't provide support for using WP-CLI in general. Please see their own documentation.