# Install & update WordPress languages with WP-CLI

**URL:** https://discourse.roots.io/t/install-update-wordpress-languages-with-wp-cli/6454
**Category:** trellis
**Created:** 2016-04-13T08:14:09Z
**Posts:** 5
**Showing post:** 1 of 5

## Post 1 by @scherii — 2016-04-13T08:14:10Z

My workflow now consists of the following lines in `deploy-hooks/build-after.yml` (which must be included in your `deploy.yml`):

```
- name: Install language de_CH
  command: php ~/bin/wp core language install de_CH
  args:
    chdir: "{{ deploy_helper.new_release_path }}"

- name: Install language de_DE
  command: php ~/bin/wp core language install de_DE
  args:
    chdir: "{{ deploy_helper.new_release_path }}"

- name: Update language files
  command: php ~/bin/wp core language update
  args:
    chdir: "{{ deploy_helper.new_release_path }}"
```

Works like a charm!

**If anyone knows how to improve this (like merge the 3 commands), feel free to share.** :slight_smile:

You may have to change the path from `php ~/bin/wp` to where WP-CLI is installed on your server.

* * *

I use Bernhard Kau’s [Language Fallback](https://wordpress.org/plugins/language-fallback/) plugin to… well… define a _fallback_ language. Same goes for Spanish (Mexico) `es_MX` to Spanish `es_ES`.

---

_[View the full topic](https://discourse.roots.io/t/install-update-wordpress-languages-with-wp-cli/6454)._
