brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: wp language core installs and updates WordPress translations

WordPress
~/tips/tip-wordpress-wp-language-core

wp language core install nl_NL

Lists, installs and updates the core language packs of a WordPress site from the command line.

Adding Dutch to a site normally means clicking through Settings. WP-CLI does it in two commands, and the same family keeps translations current.

wp language core list --status=installed
wp language core install nl_NL
wp site switch-language nl_NL
wp language core update

wp language core list shows the available languages with their English and native names and their status. With --status=installed you only see what is on the site. install downloads a language pack, and update updates the installed ones for core.

The subcommands in the WP-CLI handbook also include activate, is-installed and uninstall. is-installed is useful in scripts, since it checks whether a language exists on the site.

The caveat is that installing a language does not make the site use it. The handbook’s own example follows the install with wp site switch-language nl_NL to switch the site language. Users can also choose a language in their own profile.

This covers core only. Plugins and themes have their own wp language plugin and wp language theme commands, and updating language packs is separate from updating the code itself. Run it as the user that owns the files, since the packs are written to wp-content/languages.

Further reading: WP-CLI: wp language core

More WordPress tips wp user application-password create anna backup-script --porcelain define( 'MEDIA_TRASH', true ); wp cli check-update wp theme delete --all wp media image-size All WordPress tips (85) All topics

Link