First time here? Check out the FAQ!

Martin Burchell's profile - activity

9 years ago received badge Notable Question (source)
10 years ago received badge Popular Question (source)
12 years ago received badge Popular Question (source)
12 years ago received badge Famous Question (source)
13 years ago received badge Famous Question (source)
13 years ago received badge Necromancer ( source )
13 years ago received badge Teacher ( source )
13 years ago received badge Self-Learner ( source )
13 years ago answered a question How do we include "external" templates in our custom skin?
14 years ago received badge Editor (source)
14 years ago asked a question Error '_' is undefined

I'm not sure what I've done here (maybe messed up my configuration) but I'm seeing this error:

Exception Type: UndefinedError at /forum/questions/
Exception Value: '_' is undefined

Full trace at http://dpaste.com/561250/

askbot 0.7.3

Does this ring any bells?

Edit:
USE_I18N = True
Settings are at http://dpaste.com/561263/

Also the other pages work fine eg tags, people, badges and I can see the French translation. It's just the questions page that shows this problem.

Edit: Replacing _() with gettext() in tab_bar.html fixes the problem. Using jinja2 2.5.5.

14 years ago commented answer How do we include "external" templates in our custom skin?
Thanks. I think we're going to hit another problem because we're not using jinja2 for our templates so it might be that we'll end up having to replicate modified versions of our templates in our custom skin directory after all. Either that or fix our templates to be compatible with jinja2 but that will be a lot of work.
14 years ago commented answer How do we include "external" templates in our custom skin?
Hi Evgeny. Thanks for your answer. We are using ASKBOT_EXTRA_SKINS_DIR and have put the custom skin in there. But we want our skin to be based on templates that exist elsewhere in our application and don't want to have to place copies of them in our custom skins directory.
14 years ago received badge Nice Question (source)
14 years ago received badge Student (source)
14 years ago asked a question How do we include "external" templates in our custom skin?

Hi

We've created a custom skin and we're trying to base our skin on templates used elsewhere on our website ie those present in TEMPLATE_DIRS. Is this a bad idea?

It looks like askbot is only looking in the skins directory for templates as it can't find templates in our application. Looking at the SkinEnvironment class in skins/loaders.py, _get_loaders() creates file system loaders for the custom skin directory. We can modify this to append TEMPLATE_DIRS to the loaders and it seems to work. Is there a better way to do what we want? I guess we could use symbolic links from the skin directory to the application templates directory but that seems a bit of a hack.

I suppose ultimately we're looking to embed askbot so that it looks like any of the other pages on our website so tell us if we're going about this the wrong way.