最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Install wordpress using composer in a specific language

programmeradmin1浏览0评论

I'm using composer to automatically deploy wordpress on a ubuntu-server. Additionally, I need to install the german language pack. I learned that there are some guys who create composer-packages from the wordpress files. Using the following composer.json I get wordpress with german language pack:

{
    "repositories": [{
        "type": "composer",
        "url": ""
    }],
    "require": {
        "johnpbloch/wordpress": "4.6",
        "koodimonni-language/core-de_de": "*"
    },
    "extra": {
        "wordpress-install-dir": "wp",
        "dropin-paths": {
            "wp/wp-content/languages": ["vendor:koodimonni-language"],
            "wp/wp-content/languages/plugins/": ["vendor:koodimonni-plugin-language"],
            "wp/wp-content/languages/themes/": ["vendor:koodimonni-theme-language"]
        }
    }
}

The problem is, that wordpress itself is still in english. Is it possible to set it automatically to german, so that I don't have to do this manually for every site in the adminpanel?

I'm using composer to automatically deploy wordpress on a ubuntu-server. Additionally, I need to install the german language pack. I learned that there are some guys who create composer-packages from the wordpress files. Using the following composer.json I get wordpress with german language pack:

{
    "repositories": [{
        "type": "composer",
        "url": "https://wp-languages.github.io"
    }],
    "require": {
        "johnpbloch/wordpress": "4.6",
        "koodimonni-language/core-de_de": "*"
    },
    "extra": {
        "wordpress-install-dir": "wp",
        "dropin-paths": {
            "wp/wp-content/languages": ["vendor:koodimonni-language"],
            "wp/wp-content/languages/plugins/": ["vendor:koodimonni-plugin-language"],
            "wp/wp-content/languages/themes/": ["vendor:koodimonni-theme-language"]
        }
    }
}

The problem is, that wordpress itself is still in english. Is it possible to set it automatically to german, so that I don't have to do this manually for every site in the adminpanel?

Share Improve this question asked Sep 4, 2016 at 10:18 LionLion 1294 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

The current WP versions expose interface for this and store locale in WPLANG option. Depending on your tools you could set it up during your spin up process (for example with WP CLI).

Older version used WPLANG constant in wp-config.php. I think it should still work on a fresh install (if you don't have option set up) so you could include it in whatever process you use to write wp-config.php.

发布评论

评论列表(0)

  1. 暂无评论