Last active
January 31, 2023 13:36
-
-
Save MaximeCulea/036dab09221e2402480b13e320ef8fc5 to your computer and use it in GitHub Desktop.
Play with WordPress languages in cli.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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