okfde / froide

Freedom Of Information Portal
MIT License
366 stars 86 forks source link

Gettext issues on heroku #194

Open Alexander-Minyushkin opened 8 years ago

Alexander-Minyushkin commented 8 years ago

In bin/post_compile you load file wich is not available,

GETTEXT_TARBALL=https://s3-eu-west-1.amazonaws.com/midgard-heroku/gettext.tar.gz

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AllAccessDisabled</Code><Message>All access to this object has been disabled</Message><RequestId>689A580334F43924</RequestId><HostId>WkT/QDZYseFdsx/EbYpafs3OIW11LDVQV5SjhSAoUO+Yz4DFxM6ikebKTT8T8XkHu1Gy7dtetBI=</HostId></Error>

Changing to latest version of gettext doesn't work either:

GETTEXT_TARBALL=http://ftp.gnu.org/pub/gnu/gettext/gettext-latest.tar.gz

remote: -----> Running post-compile hook
remote: -----> In post-compile hook
remote: -----> Installing gettext msgfmt...
remote: -----> done installing gettext msgfmt
remote: -----> Compiling translation files
remote:        CommandError: Can't find msgfmt. Make sure you have GNU gettext tools 0.15 or newer installed.
stefanw commented 8 years ago

Interesting, I haven't deployed on Heroku in a while. There are a couple of options: 1) You don't care about translation, so ignore it and run in English 2) Commit compiled translation files (.mo) and push them to Heroku 3) Use a build pack of some sort, try one of these maybe

Sorry I can't be of more help as Heroku was just a demo deployment. If you figure out a good solution, please let me know!

stefanw commented 8 years ago

You might also try to swap out the gettext URL with the one here: https://github.com/lexifdev/heroku-buildpack-gettext/blob/master/bin/compile

The tarball should contain the gettext binaries compiled to run on the Heroku platform, so not the source tarball you linked to. And don't forget to adjust the GETTEXT_CHECKSUM.

Alexander-Minyushkin commented 8 years ago

Thanks! looks like GETTEXT_TARBALL=http://fb_wanted.s3.amazonaws.com/bp/gettext.tar.gz did the job But now it compile all possible languages, not that defined in settings.LANGUAGES

stefanw commented 8 years ago

Better than nothing ;) You can add the -l flag to compilemessages.

pdehaye commented 8 years ago

The proposed fix works.