Skip to content

Add language/locale parameter to "wp core install" command #104

@j-falk

Description

@j-falk

We are managing WordPress core through composer (https://packagist.org/packages/johnpbloch/wordpress-core), so it is not a localized wp package, but often install it in another language than the default en_US. Historically we have then been including translations through composer packages from https://wp-languages.github.io/ (which we probably don't need any more with all the improved language functionality in wp-cli).

However, our problem relates to the install process. Since we don't have use a localized WordPress package (eg that wp core download --locale=sv_SE would have given us), when we run wp core install it will be setup using en_US language.

We can also not run wp languages core activate sv_SE before the install since that requires wp core install to be run first.

We can obviously install/activate another language after installation but that then means that in the installation process, which typically creates a post/page/comment/default category, our content will still be in en_US.

So my suggestion would be to allow wp core install to be used with a language/locale parameter so a site can be installed with a specific language without using a localized wp core package.

I think it makes sense since the actual wp_install function in wp-admin/includes/upgrade.php also got this parameter (think it was added in to WP 4.0).

This would then mean that we could run:

wp language core install sv_SE
wp core install --locale=sv_SE

and then have a site which also have content in the correct language.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions