xyu / heroku-wp

WordPress on Heroku
MIT License
871 stars 282 forks source link

Why can't language be changed? #31

Closed algodave closed 9 years ago

algodave commented 9 years ago

I deployed Wordpress to Heroku really straightforward thanks to this cool project! However, I need to create a blog in Italian and I was expecting to be able to change the site language in the admin panel (as I've done on a previous 4.1 install of mine), but only English was selectable:

screen shot 2015-03-09 at 16 50 10

I also tried to comment wp-config.php#L134 but no luck.

Is that because Wordpress is installed as a composer package? I have another WP Heroku deploy which is using the 4.1 branch on github, and I was able to select among all languages there.

Thank you!

xyu commented 9 years ago

This is because WP is set to read-only mode which disables the ability of WP from downloading language packs on demand. This is done because the Heroku dyno FS should be considered temporary / ephemeral. As new dynos are spun up and down any data downloaded to a single dyno will not exist on any of the others.

It looks like language packs are not going to be supported by wpackagist (outlandishideas/wpackagist#37) which means to fix this some sort of post install script will need to be used to get composer to grab additional language packs.

algodave commented 9 years ago

Thank you for explaining :)

xyu commented 9 years ago

@algodave so after thinking about this I think the best way to go about this is to manually commit the language files into the cloned repo. I have not tried it however the following should work.

Create public/wp-content/languages then download the .mo file for the lang you want (http://wpcentral.io/internationalization/) into it and comment.

If you want to give this a try and it works would you mind updating the README with this information and sending in a pull request?

Thanks!

xyu commented 9 years ago

Closing this issue as #31 explains how to add languages.