Skip to content

Instantly share code, notes, and snippets.

@MaximeCulea
Last active January 31, 2023 13:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaximeCulea/036dab09221e2402480b13e320ef8fc5 to your computer and use it in GitHub Desktop.
Save MaximeCulea/036dab09221e2402480b13e320ef8fc5 to your computer and use it in GitHub Desktop.
Play with WordPress languages in cli.
#!/bin/bash
# Note the fifference between Install and Update
# Install : if the language doesn't exist, this is the first step to get the last asked language package. It is also needed, in order to update.
# Update : will get the last asked translation package, only if the language is already installed.
# Install core in french if not existing
wp language core install fr_FR
# Update all existing core languages
wp language core update
# Install a theme language if not existing
wp language theme install twentyseventeen fr_FR
# Update all themes languages
wp language theme update --all
# Install for all plugins, the french language
wp language plugin install fr_FR --all
# Update for all plugins, the french language
wp language plugin update --all
# In a multisite, install and update all languages for plugins and core
# @see https://gist.github.com/MaximeCulea/575e493a061359edbb12cefc3aa4c770#file-wp-cli-ms-cheatset-php-L43
# For doing a more complex demand, as downloading all the languages
https://gist.github.com/johnbillion/5f6c6395f660282ddb5814f4fb62c8fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment