spiroid / pelican-hpstr

Port of jekyll-hpstr-theme to pelican
GNU General Public License v2.0
4 stars 3 forks source link

CRITICAL: '_' is undefined #4

Closed esafak closed 10 years ago

esafak commented 10 years ago

I got this error message when trying to compile the site. Thanks to the detective-work of @ingwinlu, I was able to determine that I needed to install the package python-gettext and edit my pelican configuration file to include JINJA_EXTENSIONS = ['jinja2.ext.i18n'], in addition to the additions already mentioned.

spiroid commented 10 years ago

@esafak yes, sure, thanks for opening this issue. :+1:

I'll add that to the readme.

I also need to create a real theme development documentation, explaining how it all works with grunt, and how to install all the dependencies.

what would you think about versionning the .mo files with the theme? This way, the localization files would be directly available, without the need to generate them.

spiroid commented 10 years ago

@esafak: can you please check the attached pull request ?

esafak commented 10 years ago

I don't see python-gettext in requirements.txt; is it automatically included by one of the others you added?

I agree about explaining grunt; it's not something most python users are familiar with (I wasn't). At first I couldn't tell whether it was a vestige of the Jekyll theme or something that still served a purpose. Now I use it to automatically compile the SCSS.

spiroid commented 10 years ago

For me only the Babel lib is required to process, extract, init and compile catalog files. I followed the i18n_subsite plugin guide for localizing templates. I initialized a virtualenv with the versionned requirements.txt and the commands worked.

I also tried to generate the website with a new empty virtualenv with only pelican and markdown libs installed (no python-gettext) and it worked.

About Grunt, i'll create a new issue to add development docuementation.

Can you please checkout the gettext branch, or the pull request attached and confirm that it also works for you ?

esafak commented 10 years ago

It worked in python 2.7.3 under Ubuntu 12.04. gettext appears to be a standard package; I'm not sure why I had difficulties before, but maybe people who find themselves in the same situation will find this bug report and install the package. For others it will hopefully "just work".