Skip to content

Commit

Permalink
Merge pull request #19 from saucal/improve-wp-locale
Browse files Browse the repository at this point in the history
Avoid downloading first in english, and then switching language.
  • Loading branch information
tomjn committed Oct 2, 2019
2 parents 66c31bb + c0f2dd0 commit 6824eb6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions provision/vvv-init.sh
Expand Up @@ -7,6 +7,7 @@ echo " * Custom site template provisioner - downloads and installs a copy of WP
DOMAIN=`get_primary_host "${VVV_SITE_NAME}".test`
SITE_TITLE=`get_config_value 'site_title' "${DOMAIN}"`
WP_VERSION=`get_config_value 'wp_version' 'latest'`
WP_LOCALE=`get_config_value 'locale' 'en_US'`
WP_TYPE=`get_config_value 'wp_type' "single"`
DB_NAME=`get_config_value 'db_name' "${VVV_SITE_NAME}"`
DB_NAME=${DB_NAME//[\\\/\.\<\>\:\"\'\|\?\!\*-]/}
Expand All @@ -29,7 +30,7 @@ if [ "${WP_TYPE}" != "none" ]; then
# Install and configure the latest stable version of WordPress
if [[ ! -f "${VVV_PATH_TO_SITE}/public_html/wp-load.php" ]]; then
echo "Downloading WordPress..."
noroot wp core download --version="${WP_VERSION}"
noroot wp core download --locale="${WP_LOCALE}" --version="${WP_VERSION}"
fi

if [[ ! -f "${VVV_PATH_TO_SITE}/public_html/wp-config.php" ]]; then
Expand Down Expand Up @@ -103,10 +104,4 @@ if [ ! -z "${WP_PLUGINS}" ]; then
done
fi

WP_LOCALE=`get_config_value 'locale' ''`
if [ ! -z "${WP_LOCALE}" ]; then
noroot wp language core install "${WP_LOCALE}" 2>/dev/null
noroot wp site switch-language "${WP_LOCALE}" 2>/dev/null
fi

echo "Site Template provisioner script completed"

0 comments on commit 6824eb6

Please sign in to comment.